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