From 040f0d3bfbb71289cdc91c63dd097fc3d832e80f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 16 Mar 2017 03:14:12 +0000 Subject: aggregate/pmq: avoid File#stat allocation File#size is available in modern Rubies so the extra syscall is avoided. --- lib/raindrops/aggregate/pmq.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/raindrops/aggregate/pmq.rb b/lib/raindrops/aggregate/pmq.rb index 5a6a1f6..98d4169 100644 --- a/lib/raindrops/aggregate/pmq.rb +++ b/lib/raindrops/aggregate/pmq.rb @@ -153,7 +153,7 @@ class Raindrops::Aggregate::PMQ Marshal.load(synchronize(@rd, RDLOCK) do |rd| dst = StringIO.new dst.binmode - IO.copy_stream(rd, dst, rd.stat.size, 0) + IO.copy_stream(rd, dst, rd.size, 0) dst.string end) end -- cgit v1.2.3-24-ge0c7