]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
buffer: skip crc calc on zero length bufferptrs
authorSage Weil <sage@newdream.net>
Tue, 28 Oct 2008 20:47:16 +0000 (13:47 -0700)
committerSage Weil <sage@newdream.net>
Tue, 28 Oct 2008 20:47:43 +0000 (13:47 -0700)
src/include/buffer.h

index 6170b095ed43fa3057173a5f8cb120a2dc3d1c78..d4fb4d3c04d202787cd992a767fa957dd8da534b 100644 (file)
@@ -964,7 +964,8 @@ public:
       for (std::list<ptr>::const_iterator it = _buffers.begin(); 
           it != _buffers.end(); 
           it++)
-       crc = crc32c_le(crc, (unsigned char*)it->c_str(), it->length());
+       if (it->length())
+         crc = crc32c_le(crc, (unsigned char*)it->c_str(), it->length());
       return crc;
     }