add Cursor::isAtEnd()
authorAdam Simpkins <simpkins@fb.com>
Thu, 12 Mar 2015 23:00:31 +0000 (16:00 -0700)
committerAndre Azevedo <aap@fb.com>
Wed, 18 Mar 2015 03:18:45 +0000 (20:18 -0700)
commitefca08ae72f06fb6d2ba6941600f459d3e7bcc62
tree3a3178761d5a4778e2207d6ee49c09a06ac8de9b
parent5924c69c7c9839825554c8d5723644ce36f6a4e7
add Cursor::isAtEnd()

Summary:
Add a helper method to efficiently check if the cursor is at the end of the
IOBuf chain.  This is equivalent to (cursor.totalLength() > 0), but it doesn't
need to walk the entire chain just to tell if it is at the end or not.

Test Plan: Updated the unit tests to contain some checks for isAtEnd().

Reviewed By: jasmeetbagga@fb.com

Subscribers: trunkagent, doug, net-systems@, exa, folly-diffs@, yfeldblum

FB internal diff: D1875345

Signature: t1:1875345:1425006512:49ac246fd0ac7937fdcd6cf1359a841f048c444e
folly/io/Cursor.h
folly/io/test/IOBufCursorTest.cpp