c32rtomb/mbrtoc32: remove dead code.
When we added the fast path for the common case of ASCII, we forgot to
remove the now-dead code that handled the 1-byte case later in these
functions. This was obvious from the code coverage data.
Note that the 16-bit variants are unaffected because they're implemented
as calls to the 32-bit variants with extra range checks/surrogate
handling surrounding the call.
Test: treehugger
Change-Id: Ibd40f823519acb9aae8037bdeb3f9c5e36b9d9a6
diff --git a/libc/bionic/c32rtomb.cpp b/libc/bionic/c32rtomb.cpp
index d2519b9..4fa76ff 100644
--- a/libc/bionic/c32rtomb.cpp
+++ b/libc/bionic/c32rtomb.cpp
@@ -66,10 +66,8 @@
// about the sequence length.
uint8_t lead;
size_t length;
- if ((c32 & ~0x7f) == 0) {
- lead = 0;
- length = 1;
- } else if ((c32 & ~0x7ff) == 0) {
+ // We already handled the 1-byte case above, so we go straight to 2-bytes...
+ if ((c32 & ~0x7ff) == 0) {
lead = 0xc0;
length = 2;
} else if ((c32 & ~0xffff) == 0) {