Skip to content

Commit 6a7b086

Browse files
dmuir-gsparkprime
authored andcommitted
Make asciiLower & asciiUpper more readable.
1 parent c5bd75a commit 6a7b086

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/vm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,8 +1407,8 @@ class Interpreter {
14071407
const auto *str = static_cast<const HeapString *>(args[0].v.h);
14081408
UString new_str(str->value);
14091409
for (int i = 0; i < new_str.size(); ++i) {
1410-
if (new_str[i] > 64 && new_str[i] < 91) {
1411-
new_str[i] = new_str[i] + 32;
1410+
if (new_str[i] >= 'A' && new_str[i] <= 'Z') {
1411+
new_str[i] = new_str[i] - 'A' + 'a';
14121412
}
14131413
}
14141414
scratch = makeString(new_str);
@@ -1421,8 +1421,8 @@ class Interpreter {
14211421
const auto *str = static_cast<const HeapString *>(args[0].v.h);
14221422
UString new_str(str->value);
14231423
for (int i = 0; i < new_str.size(); ++i) {
1424-
if (new_str[i] > 96 && new_str[i] < 123) {
1425-
new_str[i] = new_str[i] - 32;
1424+
if (new_str[i] >= 'a' && new_str[i] <= 'z') {
1425+
new_str[i] = new_str[i] - 'a' + 'A';
14261426
}
14271427
}
14281428
scratch = makeString(new_str);

0 commit comments

Comments
 (0)