about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-14 09:37:20 +0000
committerEric Wong <e@80x24.org>2015-09-14 10:15:04 +0000
commit2300d4afc5521f3faff20ecbaf078d4777f14916 (patch)
tree93b2f3551f1928a343b57b96f9bfe7ad6b0af9ec
parenta753376878eebf42047550ccf5fa881129d8048d (diff)
downloadmogilefs-client-2300d4afc5521f3faff20ecbaf078d4777f14916.tar.gz
It is possible to disable MD5 verification, so we cannot risk
updating a nil object.

Also, favor explicitly calling "update" instead of using "<<" which
YARV will attempt to optimize for Array/String receivers at the cost
of other objects (such as Digest::MD5)
-rw-r--r--lib/mogilefs/bigfile/filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mogilefs/bigfile/filter.rb b/lib/mogilefs/bigfile/filter.rb
index d831312..e3b6874 100644
--- a/lib/mogilefs/bigfile/filter.rb
+++ b/lib/mogilefs/bigfile/filter.rb
@@ -51,7 +51,7 @@ class MogileFS::Bigfile::Filter
     if @zi
       buf = @zi.inflate(buf)
     else
-      @md5 << buf
+      @md5.update(buf) if @md5
     end
     @io.write(buf)
   end