Skip to content

Commit c93bea3

Browse files
akosthekissLaszloLango
authored andcommitted
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
1 parent 64051b5 commit c93bea3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

jerry-core/api/jerry-snapshot.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,7 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source
16401640
* Save all of the literals in C format as well.
16411641
*/
16421642
if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT
1643-
&& (!is_c_format
1644-
|| (is_c_format && ecma_string_is_valid_identifier (literal_p))))
1643+
&& (!is_c_format || ecma_string_is_valid_identifier (literal_p)))
16451644
{
16461645
literal_count++;
16471646
}
@@ -1679,8 +1678,7 @@ jerry_parse_and_save_literals (const jerry_char_t *source_p, /**< script source
16791678
* Save all of the literals in C format as well.
16801679
*/
16811680
if (ecma_get_string_magic (literal_p) == LIT_MAGIC_STRING__COUNT
1682-
&& (!is_c_format
1683-
|| (is_c_format && ecma_string_is_valid_identifier (literal_p))))
1681+
&& (!is_c_format || ecma_string_is_valid_identifier (literal_p)))
16841682
{
16851683
literal_array[literal_idx++] = literal_p;
16861684
}

0 commit comments

Comments
 (0)