Merge "Improve <ctype.h> and <wctype.h> test coverage slightly." into main
diff --git a/libc/bionic/wctype.cpp b/libc/bionic/wctype.cpp
index 76f922f..b37f17b 100644
--- a/libc/bionic/wctype.cpp
+++ b/libc/bionic/wctype.cpp
@@ -109,10 +109,7 @@
}
wint_t towlower(wint_t wc) {
- if (wc < 0x80) {
- if (wc >= 'A' && wc <= 'Z') return wc | 0x20;
- return wc;
- }
+ if (wc < 0x80) return tolower(wc);
typedef UChar32 (*FnT)(UChar32);
static auto u_tolower = reinterpret_cast<FnT>(__find_icu_symbol("u_tolower"));
@@ -120,12 +117,7 @@
}
wint_t towupper(wint_t wc) {
- if (wc < 0x80) {
- // Using EOR rather than AND makes no difference on arm, but saves an
- // instruction on arm64.
- if (wc >= 'a' && wc <= 'z') return wc ^ 0x20;
- return wc;
- }
+ if (wc < 0x80) return toupper(wc);
typedef UChar32 (*FnT)(UChar32);
static auto u_toupper = reinterpret_cast<FnT>(__find_icu_symbol("u_toupper"));