aboutsummaryrefslogtreecommitdiff
path: root/src/unicode.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-05-27 22:09:11 +0100
committergingerBill <bill@gingerbill.org>2018-05-27 22:09:11 +0100
commit547a2831c7d7b66f823947e75c18c40329510b5a (patch)
tree3d1eb6a0ef7eb3255cd54fd953d36fd14f2c5aec /src/unicode.cpp
parent5c52ffe24e86241de2057dbf62c3012432aa1db0 (diff)
Clean up name mangling by using unique package names per project
Diffstat (limited to 'src/unicode.cpp')
-rw-r--r--src/unicode.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/unicode.cpp b/src/unicode.cpp
index 538e6adce..78c94e84e 100644
--- a/src/unicode.cpp
+++ b/src/unicode.cpp
@@ -9,9 +9,11 @@ extern "C" {
bool rune_is_letter(Rune r) {
- if ((r < 0x80 && gb_char_is_alpha(cast(char)r)) ||
- r == '_') {
- return true;
+ if (r < 0x80) {
+ if (r == '_') {
+ return true;
+ }
+ return gb_char_is_alpha(cast(char)r) != 0;
}
switch (utf8proc_category(r)) {
case UTF8PROC_CATEGORY_LU:
@@ -25,8 +27,8 @@ bool rune_is_letter(Rune r) {
}
bool rune_is_digit(Rune r) {
- if (r < 0x80 && gb_is_between(r, '0', '9')) {
- return true;
+ if (r < 0x80) {
+ return gb_is_between(r, '0', '9');
}
return utf8proc_category(r) == UTF8PROC_CATEGORY_ND;
}