mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Use mrb_get_arg1() instead of mrb_get_args() for single argument
This commit is contained in:
@@ -1177,9 +1177,8 @@ mrb_str_del_suffix(mrb_state *mrb, mrb_value self)
|
||||
static mrb_value
|
||||
mrb_str_casecmp(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value str;
|
||||
mrb_value str = mrb_get_arg1(mrb);
|
||||
|
||||
mrb_get_args(mrb, "o", &str);
|
||||
if (!mrb_string_p(str)) return mrb_nil_value();
|
||||
|
||||
struct RString *s1 = mrb_str_ptr(self);
|
||||
|
||||
@@ -56,9 +56,8 @@ istruct_test_test_receive(mrb_state *mrb, mrb_value self)
|
||||
static mrb_value
|
||||
istruct_test_test_receive_direct(mrb_state *mrb, mrb_value self)
|
||||
{
|
||||
mrb_value is;
|
||||
mrb_value is = mrb_get_arg1(mrb);
|
||||
struct RClass *klass = mrb_class_get(mrb, "InlineStructTest");
|
||||
mrb_get_args(mrb, "o", &is);
|
||||
/* if you need to protect istruct retrieval from untrusted code,
|
||||
you need to care about class replacing.
|
||||
See mrbgem/mruby-random/src/random.c for detail */
|
||||
|
||||
Reference in New Issue
Block a user