string.c (chars2bytes): simplify the condition to detect break

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-01-11 11:49:49 +09:00
parent 787439455c
commit e42f3b36f9
+1 -1
View File
@@ -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;
}