Skip to content

Commit

Permalink
Add const to coro::UnboundedQueue::size/empty()
Browse files Browse the repository at this point in the history
Summary:
We have them for `BoundedQueue`.

https://www.internalfb.com/code/fbsource/[6063be9f5707]/fbcode/folly/experimental/coro/BoundedQueue.h?lines=97,99

Reviewed By: iahs

Differential Revision: D51515453

fbshipit-source-id: e599f950d97c2956c59f009ff975da0ec82a8ed1
  • Loading branch information
Arnie Yuan authored and facebook-github-bot committed Nov 22, 2023
1 parent 49ae1ef commit 1a1dfd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions folly/experimental/coro/UnboundedQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ class UnboundedQueue {
return sem_.try_wait() ? queue_.try_dequeue(out) : false;
}

bool empty() { return queue_.empty(); }
bool empty() const { return queue_.empty(); }

const T* try_peek() noexcept { return queue_.try_peek(); }

size_t size() { return queue_.size(); }
size_t size() const { return queue_.size(); }

private:
folly::UnboundedQueue<T, SingleProducer, SingleConsumer, false> queue_;
Expand Down

0 comments on commit 1a1dfd6

Please sign in to comment.