Skip to content

Commit 8065f9c

Browse files
Refactor tolower_ucs4 and toupper_ucs4 functions by removing fallback logic for non-ASCII characters
1 parent 124dceb commit 8065f9c

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

mypyc/lib-rt/str_ops.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -575,24 +575,14 @@ static inline Py_UCS4 tolower_ucs4(Py_UCS4 ch) {
575575
if (ch < 128) {
576576
return ascii_lower_table[ch];
577577
}
578-
#ifdef Py_UNICODE_TOLOWER
579578
return Py_UNICODE_TOLOWER(ch);
580-
#else
581-
// fallback: no-op for non-ASCII if macro is unavailable
582-
return ch;
583-
#endif
584579
}
585580

586581
static inline Py_UCS4 toupper_ucs4(Py_UCS4 ch) {
587582
if (ch < 128) {
588583
return ascii_upper_table[ch];
589584
}
590-
#ifdef Py_UNICODE_TOUPPER
591585
return Py_UNICODE_TOUPPER(ch);
592-
#else
593-
// fallback: no-op for non-ASCII if macro is unavailable
594-
return ch;
595-
#endif
596586
}
597587

598588
// Implementation of s.lower()

0 commit comments

Comments
 (0)