diff options
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/string.c b/src/string.c index b2946aac..11c12bee 100644 --- a/src/string.c +++ b/src/string.c @@ -49,16 +49,10 @@ serd_strerror(const SerdStatus status) static void serd_update_flags(const uint8_t c, SerdNodeFlags* const flags) { - switch (c) { - case '\r': - case '\n': + if (c == '\r' || c == '\n') { *flags |= SERD_HAS_NEWLINE; - break; - case '"': + } else if (c == '"') { *flags |= SERD_HAS_QUOTE; - break; - default: - break; } } @@ -116,16 +110,11 @@ read_sign(const char** const sptr) { double sign = 1.0; - switch (**sptr) { - case '-': + if (**sptr == '-') { sign = -1.0; ++(*sptr); - break; - case '+': + } else if (**sptr == '+') { ++(*sptr); - break; - default: - break; } return sign; |