Commit de0fe30e authored by Philip Pronin's avatar Philip Pronin Committed by Sara Golemon

make IOBuf::coalesce return ByteRange

Test Plan: fbconfig -r folly/io && fbmake opt -j32 && fbmake runtests_opt

@override-unit-failures

Reviewed By: soren@fb.com

FB internal diff: D1005735
parent 44365277
......@@ -895,12 +895,14 @@ class IOBuf {
* Throws std::bad_alloc on error. On error the IOBuf chain will be
* unmodified. Throws std::overflow_error if the length of the entire chain
* larger than can be described by a uint32_t capacity.
*
* Returns ByteRange that points to the data IOBuf stores.
*/
void coalesce() {
if (!isChained()) {
return;
ByteRange coalesce() {
if (isChained()) {
coalesceSlow();
}
coalesceSlow();
return ByteRange(data_, length_);
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment