Skip to content

Commit

Permalink
Remove IOBufQueue::clear()
Browse files Browse the repository at this point in the history
Summary: All usages in fbsource have been removed.

Reviewed By: yfeldblum, philippv

Differential Revision: D33007671

fbshipit-source-id: 74c5f2dad098c6b7cf7085aa1a2e01a48fa81781
  • Loading branch information
ot authored and facebook-github-bot committed Dec 12, 2021
1 parent 6e2d12f commit 8597900
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
13 changes: 0 additions & 13 deletions folly/io/IOBufQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,19 +395,6 @@ std::unique_ptr<folly::IOBuf> IOBufQueue::pop_front() {
return retBuf;
}

void IOBufQueue::clear() {
if (!head_) {
return;
}
auto guard = updateGuard();
IOBuf* buf = head_.get();
do {
buf->clear();
buf = buf->next();
} while (buf != head_.get());
chainLength_ = 0;
}

void IOBufQueue::clearAndTryReuseLargestBuffer() {
auto guard = updateGuard();
std::unique_ptr<folly::IOBuf> best;
Expand Down
11 changes: 0 additions & 11 deletions folly/io/IOBufQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,17 +517,6 @@ class IOBufQueue {

const Options& options() const { return options_; }

/**
* Clear the queue. Note that this does not release the buffers, it
* just sets their length to zero; useful if you want to reuse the
* same queue without reallocating.
*
* DEPRECATED: If the queue is chained, only the last buffer will actually be
* reused. In most cases, reset() should be used instead, or if reuse is
* intended, clearAndTryReuseLargestBuffer().
*/
void clear();

/**
* Clear the queue, freeing all the buffers. Options are preserved.
*/
Expand Down

0 comments on commit 8597900

Please sign in to comment.