diff options
author | Eric Wong <e@80x24.org> | 2018-06-19 03:57:14 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2018-06-19 23:59:49 +0000 |
commit | c9077a28044b32799dfd512620d25cb3cba0c6c4 (patch) | |
tree | 8215a42db499b7652aede83df63dd6d868a2b45d | |
parent | 58c56c24325584c5c58feba5d1502c054a89f0a1 (diff) | |
download | mogilefs-client-c9077a28044b32799dfd512620d25cb3cba0c6c4.tar.gz |
String#replace keeps garbage around a bit longer, so it's not always the better option. cf. http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/86983 https://public-inbox.org/ruby-core/20180511033641.GA4459@dcvr/
-rw-r--r-- | lib/mogilefs/socket/pure_ruby.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/socket/pure_ruby.rb b/lib/mogilefs/socket/pure_ruby.rb index 59e43e1..acbbaca 100644 --- a/lib/mogilefs/socket/pure_ruby.rb +++ b/lib/mogilefs/socket/pure_ruby.rb @@ -42,7 +42,7 @@ class MogileFS::Socket < Socket rescue Errno::EAGAIN wait(timeout) or unreadable_socket!(timeout) rescue EOFError - dst.replace("") + dst.respond_to?(:clear) ? dst.clear : dst.replace("") return end while true rescue EOFError |