From c93bea32c43f507d88ac354ea411c714203ebb5a Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Sun, 5 Aug 2018 15:41:58 +0200 Subject: Simplify redundant condition in jerry-snapshot.c (#2444) Redundant condition: is_c_format. '!A || (A && B)' is equivalent to '!A || B'. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- jerry-core/api/jerry-snapshot.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'jerry-core') diff --git a/jerry-core/api/jerry-snapshot.c b/jerry-core/api/jerry-snapshot.c index 583685c7..5f96dd45 100644 --- a/jerry-core/api/jerry-snapshot.c +++ b/jerry-core/api/jerry-snapshot.c @@ -1640,8 +1640,7 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source * Save all of the literals in C format as well. */ if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT - && (!is_c_format - || (is_c_format && ecma_string_is_valid_identifier (literal_p)))) + && (!is_c_format || ecma_string_is_valid_identifier (literal_p))) { literal_count++; } @@ -1679,8 +1678,7 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source * Save all of the literals in C format as well. */ if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT - && (!is_c_format - || (is_c_format && ecma_string_is_valid_identifier (literal_p)))) + && (!is_c_format || ecma_string_is_valid_identifier (literal_p))) { literal_array[literal_idx++] = literal_p; } -- cgit v1.2.3