diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-05-27 21:43:43 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-05-27 21:43:43 +0900 |
| commit | 48b08fecba0b4dea58b8e9b0b473f47848f2fcf0 (patch) | |
| tree | b4250613d194c2506afb22600e5764ad71733126 /include | |
| parent | 9a72869043e0377ec549a325a074e592f82ef5ed (diff) | |
| download | mruby-48b08fecba0b4dea58b8e9b0b473f47848f2fcf0.tar.gz mruby-48b08fecba0b4dea58b8e9b0b473f47848f2fcf0.zip | |
array.c: unify `mrb_ary_ref` and `mrb_ary_entry`
Use only `mrb_ary_entry` hereafter.
Diffstat (limited to 'include')
| -rw-r--r-- | include/mruby/array.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/include/mruby/array.h b/include/mruby/array.h index 16f78f773..2221cab8b 100644 --- a/include/mruby/array.h +++ b/include/mruby/array.h @@ -177,20 +177,6 @@ MRB_API void mrb_ary_push(mrb_state *mrb, mrb_value array, mrb_value value); MRB_API mrb_value mrb_ary_pop(mrb_state *mrb, mrb_value ary); /* - * Returns a reference to an element of the array on the given index. - * - * Equivalent to: - * - * ary[n] - * - * @param mrb The mruby state reference. - * @param ary The target array. - * @param n The array index being referenced - * @return The referenced value. - */ -MRB_API mrb_value mrb_ary_ref(mrb_state *mrb, mrb_value ary, mrb_int n); - -/* * Sets a value on an array at the given index * * Equivalent to: @@ -243,6 +229,7 @@ MRB_API mrb_value mrb_ary_unshift(mrb_state *mrb, mrb_value self, mrb_value item * @param offset The element position (negative counts from the tail). */ MRB_API mrb_value mrb_ary_entry(mrb_value ary, mrb_int offset); +#define mrb_ary_ref(mrb, ary, n) mrb_ary_entry(ary, n) /* * Replace subsequence of an array. |
