1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-07-30 14:43:05 +03:00

Add some [[nodiscard]] and standardize on it

Summary: Add some that were missing in the codec. Also replace all FOLLY_DISCARD with [[nodiscard]] since we support it everywhere.

Reviewed By: kvtsoy

Differential Revision: D72571687

fbshipit-source-id: af296858eedcb033dcae9db1c5a3a2318e4acea7
This commit is contained in:
Matt Joras
2025-04-07 23:45:33 -07:00
committed by Facebook GitHub Bot
parent 67ce39cfdd
commit c6e39980db
22 changed files with 253 additions and 249 deletions

View File

@ -53,15 +53,15 @@ class MiddleStartingIterationWrapper {
wrappedAround_ = false;
}
FOLLY_NODISCARD const MapType::value_type& dereference() const {
[[nodiscard]] const MapType::value_type& dereference() const {
return *itr_;
}
FOLLY_NODISCARD MapType::const_iterator rawIterator() const {
[[nodiscard]] MapType::const_iterator rawIterator() const {
return itr_;
}
FOLLY_NODISCARD bool equal(const MiddleStartingIterator& other) const {
[[nodiscard]] bool equal(const MiddleStartingIterator& other) const {
return wrappedAround_ == other.wrappedAround_ && itr_ == other.itr_;
}
@ -94,11 +94,11 @@ class MiddleStartingIterationWrapper {
const MapType::const_iterator& start)
: streams_(streams), start_(&streams_, start) {}
FOLLY_NODISCARD MiddleStartingIterator cbegin() const {
[[nodiscard]] MiddleStartingIterator cbegin() const {
return start_;
}
FOLLY_NODISCARD MiddleStartingIterator cend() const {
[[nodiscard]] MiddleStartingIterator cend() const {
MiddleStartingIterator itr(start_);
itr.wrappedAround_ = true;
return itr;