diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 11:11:35 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-07-30 11:11:35 +0530 |
commit | 5ad3ae5e2e13b4af0ae91b7c8bd5cce23cdb8a94 (patch) | |
tree | 49d0df492cd05c241ecf2343a7bc94bafbb8768b | |
parent | e65f2c8cd6aab5d4bdc1da09a09dc4da969ec225 (diff) |
lexer: use isspace() and comparison instead of switch
-rw-r--r-- | src/lexer.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lexer.c b/src/lexer.c index 502290f..fff8a04 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -294,17 +294,10 @@ find_directive(char *content, key_match_t *match) size_t n = 0; for (size_t i = 0; i < match->length; i++) - switch (buffer[i]) { - case '{': - case ' ': - case '\t': - case '\n': + if (isspace(buffer[i]) || buffer[i] == '{') n++; - break; - - default: + else goto found_start; - } return NULL; |