Commit 60664823 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #3451 from dabroz/revert-string-mul

Revert "Optimization for String#* for 1-byte strings"
parents 1f2d786e 90f262f6
......@@ -872,9 +872,7 @@ mrb_str_times(mrb_state *mrb, mrb_value self)
str2 = str_new(mrb, 0, len);
str_with_class(mrb, str2, self);
p = RSTR_PTR(str2);
if (len == 1) {
memset(p, RSTRING_PTR(self)[0], len);
} else if (len > 0) {
if (len > 0) {
n = RSTRING_LEN(self);
memcpy(p, RSTRING_PTR(self), n);
while (n <= len/2) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment