Util: Code cleanup to remove unreachable code

This commit is contained in:
Vicki Pfau 2024-03-19 21:40:38 -07:00
parent aa7b9349f8
commit a2587cb8cf
1 changed files with 5 additions and 9 deletions

View File

@ -177,16 +177,12 @@ size_t toUtf8(uint32_t unichar, char* buffer) {
buffer[2] = (unichar & 0x3F) | 0x80; buffer[2] = (unichar & 0x3F) | 0x80;
return 3; return 3;
} }
if (unichar < 0x200000) {
buffer[0] = (unichar >> 18) | 0xF0;
buffer[1] = ((unichar >> 12) & 0x3F) | 0x80;
buffer[2] = ((unichar >> 6) & 0x3F) | 0x80;
buffer[3] = (unichar & 0x3F) | 0x80;
return 4;
}
// This shouldn't be possible buffer[0] = (unichar >> 18) | 0xF0;
return 0; buffer[1] = ((unichar >> 12) & 0x3F) | 0x80;
buffer[2] = ((unichar >> 6) & 0x3F) | 0x80;
buffer[3] = (unichar & 0x3F) | 0x80;
return 4;
} }
size_t toUtf16(uint32_t unichar, uint16_t* buffer) { size_t toUtf16(uint32_t unichar, uint16_t* buffer) {