Skip to content

Commit 308bff5

Browse files
committed
Code simplification
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
1 parent 3796987 commit 308bff5

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

jerry-core/ecma/operations/ecma-array-object.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,16 +417,14 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o
417417
}
418418

419419
// e.
420-
if (index >= old_len_uint32)
420+
if (index < UINT32_MAX
421+
&& index >= old_len_uint32)
421422
{
422423
ecma_property_value_t *len_prop_value_p = ECMA_PROPERTY_VALUE_PTR (len_prop_p);
423424

424425
// i., ii.
425-
if (index < UINT32_MAX)
426-
{
427-
/* Setting the length property is always successful. */
428-
ecma_value_assign_uint32 (&len_prop_value_p->value, index + 1);
429-
}
426+
/* Setting the length property is always successful. */
427+
ecma_value_assign_uint32 (&len_prop_value_p->value, index + 1);
430428
}
431429

432430
// f.

0 commit comments

Comments
 (0)