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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user