summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-10-03 17:14:00 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-10-03 17:14:00 +0900
commit09336c5d49481d56587f6e28924014954b4c8dd2 (patch)
tree2929382ec25ac34578a3ae6ee77f2dafda7964dd /src/string.c
parentd64d8ca8e4515a2e03165401470ef109a6097e5d (diff)
downloadmruby-09336c5d49481d56587f6e28924014954b4c8dd2.tar.gz
mruby-09336c5d49481d56587f6e28924014954b4c8dd2.zip
mruby/ops.h: add new instructions `OP_GETIDX` and `OP_SETIDX`.
Which represent `obj[int]` and `obj[int]=val` respectively where `obj` is either `string`, `array` or `hash`, so that index access could be faster. When `obj` is not assumed type or `R(a+1)` is not integer, the instructions fallback to method calls.
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index ac0f4a920..089c8616c 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1146,7 +1146,7 @@ range_arg:
return STR_OUT_OF_RANGE;
}
-static mrb_value
+mrb_value
mrb_str_aref(mrb_state *mrb, mrb_value str, mrb_value indx, mrb_value alen)
{
mrb_int beg, len;