Merge "c32rtomb/mbrtoc32: remove dead code."
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) {
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;