diff options
| author | dearblue <[email protected]> | 2021-08-27 22:43:25 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2021-08-27 22:43:25 +0900 |
| commit | 6ac8d14b7b01a8907eca39991cce6736f22e82c9 (patch) | |
| tree | 51c06e5d1cb87be27a71b2f962dba1cf3cc0acbd /src/string.c | |
| parent | 12a483c1bc78856aeb119dad2bfa9f77ca2f7fbc (diff) | |
| download | mruby-6ac8d14b7b01a8907eca39991cce6736f22e82c9.tar.gz mruby-6ac8d14b7b01a8907eca39991cce6736f22e82c9.zip | |
Refactor the `mrb_get_args()` function
- Removed the `ARGV` macro.
The current path doesn't go into the mruby VM and there's also no need to separate variables.
- Use common functions to check object types.
- Use `mrb_ensure_string_type()` to check the string instead of `mrb_to_str()`.
This is for consistency with array and hash.
- Use `mrb_ensure_array_type()` to check the array instead of `to_ary()`.
- Use `mrb_ensure_hash_type()` to check the hash instead of `to_hash()`.
- Add and use `ensure_class_type()` to check class and module.
- Changed the argument index type from `mrb_int` to `int`.
Even if it is `int16_t`, it is enough.
`mrb_int` is overkill, especially if `MRB_32BIT` and `MRB_INT64` are defined.
Diffstat (limited to 'src/string.c')
0 files changed, 0 insertions, 0 deletions
