mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
string.c (chars2bytes): simplify the condition to detect break
This commit is contained in:
+1
-1
@@ -340,7 +340,7 @@ chars2bytes(mrb_value s, mrb_int off, mrb_int idx)
|
||||
}
|
||||
|
||||
mrb_int len = (mrb_int)(p-p0);
|
||||
if (idx > 0 || p > e) len++;
|
||||
if (idx > 0) len++;
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user