1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:27:34 +00:00

LibJS: Use the new is_ascii_foo() helpers from AK

These constexpr helpers generate nicer code than the LibC ctype.h
variants, so let's make use of them. :^)
This commit is contained in:
Andreas Kling 2021-06-13 10:47:09 +02:00
parent d476144565
commit 39ad705c13
5 changed files with 30 additions and 31 deletions

View file

@ -6,13 +6,13 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/CharacterTypes.h>
#include <AK/GenericLexer.h>
#include <LibCore/DateTime.h>
#include <LibJS/Runtime/Date.h>
#include <LibJS/Runtime/DateConstructor.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/VM.h>
#include <ctype.h>
#include <sys/time.h>
#include <time.h>
@ -30,7 +30,7 @@ static Value parse_simplified_iso8601(const String& iso_8601)
int r = 0;
for (size_t i = 0; i < n; ++i) {
char ch = lexer.consume();
if (!isdigit(ch))
if (!is_ascii_digit(ch))
return false;
r = 10 * r + ch - '0';
}