Skip to content

Commit

Permalink
use isspace to check if a character matches regex's \s
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmichaelgo committed Jul 17, 2023
1 parent d61009d commit 6292566
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ext/liquid_c/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ static bool match_full_token_possibly_invalid(token_t *token, struct full_token_
char c = str[i];

// match \s
bool is_whitespace = (
c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' || c == '\f'
);
bool is_whitespace = isspace(c);

if (!is_word_char(c) && !is_whitespace && c != '%' && c != '-') {
match->delimiter_start = curr_delimiter_start = NULL;
Expand Down

0 comments on commit 6292566

Please sign in to comment.