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/mbrtoc32.cpp b/libc/bionic/mbrtoc32.cpp
index 21603a1..d37ca66 100644
--- a/libc/bionic/mbrtoc32.cpp
+++ b/libc/bionic/mbrtoc32.cpp
@@ -80,11 +80,8 @@
// The first byte in the state (if any) tells the length.
size_t bytes_so_far = mbstate_bytes_so_far(state);
ch = bytes_so_far > 0 ? mbstate_get_byte(state, 0) : static_cast<uint8_t>(*s);
- if ((ch & 0x80) == 0) {
- mask = 0x7f;
- length = 1;
- lower_bound = 0;
- } else if ((ch & 0xe0) == 0xc0) {
+ // We already handled the 1-byte case above, so we go straight to 2-bytes...
+ if ((ch & 0xe0) == 0xc0) {
mask = 0x1f;
length = 2;
lower_bound = 0x80;