mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
embed small string
use flags 4 for *this object is embed* use flags 8~64 for *embed string length*
This commit is contained in:
@@ -33,8 +33,8 @@ mrb_str_swapcase_bang(mrb_state *mrb, mrb_value str)
|
||||
struct RString *s = mrb_str_ptr(str);
|
||||
|
||||
mrb_str_modify(mrb, s);
|
||||
p = s->ptr;
|
||||
pend = s->ptr + s->len;
|
||||
p = s->as.heap.ptr;
|
||||
pend = s->as.heap.ptr + s->as.heap.len;
|
||||
while (p < pend) {
|
||||
if (ISUPPER(*p)) {
|
||||
*p = TOLOWER(*p);
|
||||
|
||||
Reference in New Issue
Block a user