From: Philip Pronin Date: Tue, 9 Dec 2014 21:43:33 +0000 (-0800) Subject: fix Cursor::skipAtMostSlow bug introduced in D1724111 X-Git-Tag: v0.22.0~118 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4937406820049d6ac7e950677c8cd168deb73a6d;p=folly.git fix Cursor::skipAtMostSlow bug introduced in D1724111 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 --- diff --git a/folly/io/Cursor.h b/folly/io/Cursor.h index 064aa34d..eecf42cf 100644 --- a/folly/io/Cursor.h +++ b/folly/io/Cursor.h @@ -441,7 +441,7 @@ class CursorBase { if (UNLIKELY(!tryAdvanceBuffer())) { return skipped; } - len -= skipped; + len -= available; } offset_ += len; return skipped + len;