Don't use strlen for string literals (#2517)

Their length (size) is known at compile time. Therefore `sizeof`
is more efficient for them.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-09-17 10:07:24 +02:00
committed by László Langó
parent 2d83d8ed17
commit 3d3a8008a8
24 changed files with 367 additions and 389 deletions
+8
View File
@@ -50,4 +50,12 @@ do \
srand ((unsigned) jerry_port_get_current_time ()); \
} while (0)
/**
* Dummy macro to enable the breaking of long string literals into multiple
* substrings on separate lines. (Style checker doesn't allow it without putting
* the whole literal into parentheses but the compiler warns about parenthesized
* string constants.)
*/
#define TEST_STRING_LITERAL(x) x
#endif /* !TEST_COMMON_H */