raindrops.git  about / heads / tags
real-time stats for preforking Rack servers
   commit 040f0d3bfbb71289cdc91c63dd097fc3d832e80f (patch)
   parent 160ebb0 aggregate/pmq: remove io-extra requirement
     tree 952c6547142df4915a2aa781597a85b6ecd866b5
   author Eric Wong <e@80x24.org>  2017-03-16 03:14:12 +0000
committer Eric Wong <e@80x24.org>  2017-03-18 01:28:47 +0000

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 @@ def aggregate
       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


glossary
--------
Commit objects reference one tree, and zero or more parents.

Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.

Multiple parents means the commit is a merge.

Root commits have no ancestor.  Note that it is
possible to have multiple root commits when merging independent histories.

Every commit references one top-level tree object.

git clone http://yhbt.net/raindrops.git