aboutsummaryrefslogtreecommitdiffstats
path: root/src/string_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-31 12:37:57 +0100
committerDavid Robillard <d@drobilla.net>2020-12-31 12:37:57 +0100
commit8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376 (patch)
treec65c3327fde67505a8f989e57cb245ee0f286cb9 /src/string_utils.h
parent19d8a055ff1e58a699e3679b701a1a60a2927243 (diff)
downloadserd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.tar.gz
serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.tar.bz2
serd-8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376.zip
Avoid "else" after "break" and "return"
Diffstat (limited to 'src/string_utils.h')
-rw-r--r--src/string_utils.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/string_utils.h b/src/string_utils.h
index 744ba4ca..a80c3a27 100644
--- a/src/string_utils.h
+++ b/src/string_utils.h
@@ -119,13 +119,20 @@ utf8_num_bytes(const uint8_t c)
{
if ((c & 0x80) == 0) { // Starts with `0'
return 1;
- } else if ((c & 0xE0) == 0xC0) { // Starts with `110'
+ }
+
+ if ((c & 0xE0) == 0xC0) { // Starts with `110'
return 2;
- } else if ((c & 0xF0) == 0xE0) { // Starts with `1110'
+ }
+
+ if ((c & 0xF0) == 0xE0) { // Starts with `1110'
return 3;
- } else if ((c & 0xF8) == 0xF0) { // Starts with `11110'
+ }
+
+ if ((c & 0xF8) == 0xF0) { // Starts with `11110'
return 4;
}
+
return 0;
}