mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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.
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user