diff options
| author | Tomoyuki Sahara <[email protected]> | 2014-12-17 13:37:15 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2014-12-17 13:37:15 +0900 |
| commit | e82c1d3f3829cd9057017a0848b9c101c4aab46a (patch) | |
| tree | 0875efd08a7530af2ee5bd92e5f3b05578351e97 | |
| parent | 50721e9bf88a40f45c53d83ced3e0d6702c062f5 (diff) | |
| download | mruby-e82c1d3f3829cd9057017a0848b9c101c4aab46a.tar.gz mruby-e82c1d3f3829cd9057017a0848b9c101c4aab46a.zip | |
Revert "FIX: IO#read create a large number of objects."
| -rw-r--r-- | mrblib/io.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mrblib/io.rb b/mrblib/io.rb index 51a395119..fceea1171 100644 --- a/mrblib/io.rb +++ b/mrblib/io.rb @@ -194,12 +194,12 @@ class IO if length && (str.size + @buf.size) >= length len = length - str.size - str << @buf[0, len] + str += @buf[0, len] @pos += len @buf = @buf[len, @buf.size - len] break else - str << @buf + str += @buf @pos += @buf.size @buf = '' end @@ -238,18 +238,18 @@ class IO if limit && (str.size + @buf.size) >= limit len = limit - str.size - str << @buf[0, len] + str += @buf[0, len] @pos += len @buf = @buf[len, @buf.size - len] break elsif idx = @buf.index(rs) len = idx + rs.size - str << @buf[0, len] + str += @buf[0, len] @pos += len @buf = @buf[len, @buf.size - len] break else - str << @buf + str += @buf @pos += @buf.size @buf = '' end |
