From ed08518bd754b7a078a77bf9575ce84f83865909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Lang=C3=B3?= Date: Thu, 26 May 2016 10:50:44 +0200 Subject: [PATCH] Code simplification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the enclosed condition forward and combine the two if statements. JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com --- jerry-core/ecma/operations/ecma-array-object.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jerry-core/ecma/operations/ecma-array-object.c b/jerry-core/ecma/operations/ecma-array-object.c index 1f30d0bf97..925fb162b5 100644 --- a/jerry-core/ecma/operations/ecma-array-object.c +++ b/jerry-core/ecma/operations/ecma-array-object.c @@ -418,16 +418,14 @@ ecma_op_array_object_define_own_property (ecma_object_t *obj_p, /**< the array o } // e. - if (index >= old_len_uint32) + if (index < UINT32_MAX + && index >= old_len_uint32) { ecma_property_value_t *len_prop_value_p = ECMA_PROPERTY_VALUE_PTR (len_prop_p); // i., ii. - if (index < UINT32_MAX) - { - /* Setting the length property is always successful. */ - ecma_value_assign_uint32 (&len_prop_value_p->value, index + 1); - } + /* Setting the length property is always successful. */ + ecma_value_assign_uint32 (&len_prop_value_p->value, index + 1); } // f.