From eba74c038edb6ea37deede0789e3c5c9e344de95 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 14 Apr 2022 10:55:00 +0900 Subject: [PATCH] string.c: avoid a local variable. --- src/string.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/string.c b/src/string.c index 2ab45e289..754a3b5ca 100644 --- a/src/string.c +++ b/src/string.c @@ -1984,10 +1984,9 @@ mrb_str_rindex(mrb_state *mrb, mrb_value str) { mrb_value sub; mrb_int pos; - int argc = mrb_get_args(mrb, "S|i", &sub, &pos); mrb_int len = RSTRING_CHAR_LEN(str); - if (argc == 1) { + if (mrb_get_args(mrb, "S|i", &sub, &pos) == 1) { pos = len; } else {