diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-04 13:06:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 13:06:38 +0100 |
commit | 2e320dcf8796d77b6196ef93d4ea304bf5bcb3d4 (patch) | |
tree | c8ad853c2b28149f975b2728deac960097ae3288 /tests/core/math/test_math.cpp | |
parent | d235c1bb1964b80d776a64aa2a1b198a8e52bf72 (diff) | |
parent | 244db375087440888ca5b86fd0d114a54f41489a (diff) |
Merge pull request #57617 from bruvzg/char_cleanup
Diffstat (limited to 'tests/core/math/test_math.cpp')
-rw-r--r-- | tests/core/math/test_math.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/core/math/test_math.cpp b/tests/core/math/test_math.cpp index a24a8fde2b..4182455b7a 100644 --- a/tests/core/math/test_math.cpp +++ b/tests/core/math/test_math.cpp @@ -227,7 +227,7 @@ class GetClassAndNamespace { return TK_SYMBOL; } - if (code[idx] == '-' || (code[idx] >= '0' && code[idx] <= '9')) { + if (code[idx] == '-' || is_digit(code[idx])) { //a number const char32_t *rptr; double number = String::to_float(&code[idx], &rptr); @@ -235,10 +235,10 @@ class GetClassAndNamespace { value = number; return TK_NUMBER; - } else if ((code[idx] >= 'A' && code[idx] <= 'Z') || (code[idx] >= 'a' && code[idx] <= 'z') || code[idx] > 127) { + } else if (is_ascii_char(code[idx]) || code[idx] > 127) { String id; - while ((code[idx] >= 'A' && code[idx] <= 'Z') || (code[idx] >= 'a' && code[idx] <= 'z') || code[idx] > 127) { + while (is_ascii_char(code[idx]) || code[idx] > 127) { id += code[idx]; idx++; } |