From: William Morgan Date: Sun, 26 Apr 2009 14:48:36 +0000 (-0400) Subject: replace += with << in mbox reading X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=b5379b259f56afaee2669d91e0d4aa38265210af;p=sup replace += with << in mbox reading there's a tremendous speed difference between these two operators, though neither of these points are bottlenecks. --- diff --git a/lib/sup/mbox/loader.rb b/lib/sup/mbox/loader.rb index 7fe9129..fbf31ae 100644 --- a/lib/sup/mbox/loader.rb +++ b/lib/sup/mbox/loader.rb @@ -86,7 +86,7 @@ class Loader < Source @mutex.synchronize do @f.seek offset until @f.eof? || (l = @f.gets) =~ /^\r*$/ - ret += l + ret << l end end ret @@ -94,7 +94,7 @@ class Loader < Source def raw_message offset ret = "" - each_raw_message_line(offset) { |l| ret += l } + each_raw_message_line(offset) { |l| ret << l } ret end