Skip to content

Commit cc2ed14

Browse files
Refactor CPyStr_Lower and CPyStr_Upper to use consistent variable naming for character conversion
1 parent 62520ef commit cc2ed14

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

mypyc/lib-rt/str_ops.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ PyObject *CPyStr_Lower(PyObject *self) {
579579
// Unified loop for all Unicode kinds
580580
for (Py_ssize_t i = 0; i < len; i++) {
581581
Py_UCS4 ch = PyUnicode_READ(kind, data, i);
582-
Py_UCS4 lower = Py_UNICODE_TOLOWER(ch);
583-
PyUnicode_WRITE(res_kind, res_data, i, lower);
582+
Py_UCS4 rch = Py_UNICODE_TOLOWER(ch);
583+
PyUnicode_WRITE(res_kind, res_data, i, rch);
584584
}
585585
return res;
586586
}
@@ -617,8 +617,8 @@ PyObject *CPyStr_Upper(PyObject *self) {
617617
// Unified loop for all Unicode kinds
618618
for (Py_ssize_t i = 0; i < len; i++) {
619619
Py_UCS4 ch = PyUnicode_READ(kind, data, i);
620-
Py_UCS4 upper = Py_UNICODE_TOUPPER(ch);
621-
PyUnicode_WRITE(res_kind, res_data, i, upper);
620+
Py_UCS4 rch = Py_UNICODE_TOUPPER(ch);
621+
PyUnicode_WRITE(res_kind, res_data, i, rch);
622622
}
623623
return res;
624624
}

0 commit comments

Comments
 (0)