mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
reimplement String#upcase
This commit is contained in:
+2
-1
@@ -2583,7 +2583,8 @@ mrb_str_upcase_bang(mrb_state *mrb, mrb_value str)
|
||||
char *s, *send;
|
||||
int modify = 0;
|
||||
|
||||
s = RSTRING(str)->buf; send = s + RSTRING(str)->len;
|
||||
s = RSTRING_PTR(str);
|
||||
send = RSTRING_END(str);
|
||||
while (s < send) {
|
||||
if (ISLOWER(*s)) {
|
||||
*s = toupper(*s);
|
||||
|
||||
Reference in New Issue
Block a user