fix Cursor::skipAtMostSlow bug introduced in D1724111
authorPhilip Pronin <philipp@fb.com>
Tue, 9 Dec 2014 21:43:33 +0000 (13:43 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 16:01:27 +0000 (08:01 -0800)
Test Plan: fbconfig -r folly/io/test && fbmake runtests_opt -j32

Reviewed By: viswanath@fb.com

Subscribers: folly-diffs@

FB internal diff: D1728927

Tasks: 5788015

Signature: t1:1728927:1418161580:9ed66412e35c62486a56e19aa9bf119863b5f1a1

Blame Revision: D1724111

folly/io/Cursor.h

index 064aa34dc6d80d69748e5394a0733a47ead1d3bc..eecf42cfcb20590f015ebcee4640f9500322b0fd 100644 (file)
@@ -441,7 +441,7 @@ class CursorBase {
       if (UNLIKELY(!tryAdvanceBuffer())) {
         return skipped;
       }
-      len -= skipped;
+      len -= available;
     }
     offset_ += len;
     return skipped + len;