Skip to content

Commit

Permalink
Update methods to dcheck{ToSend,Received}OrEmpty()
Browse files Browse the repository at this point in the history
Summary: All but 1 of the ~12 callsites of these methods on my stack should be fine with "empty SocketFds".

Reviewed By: Gownta

Differential Revision: D45668462

fbshipit-source-id: 391384ba233a5c388a37d78beb81274ba7439e48
  • Loading branch information
snarkmaster authored and facebook-github-bot committed May 13, 2023
1 parent 1f23eee commit ace41c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions folly/io/async/fdsock/SocketFds.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ class SocketFds final {
DCHECK(!ptr_);
return *this;
}
SocketFds& dcheckReceived() {
DCHECK(std::holds_alternative<Received>(*ptr_));
SocketFds& dcheckReceivedOrEmpty() {
DCHECK(!ptr_ || std::holds_alternative<Received>(*ptr_));
return *this;
}
SocketFds& dcheckToSend() {
DCHECK(std::holds_alternative<ToSend>(*ptr_));
SocketFds& dcheckToSendOrEmpty() {
DCHECK(!ptr_ || std::holds_alternative<ToSend>(*ptr_));
return *this;
}

Expand Down

0 comments on commit ace41c0

Please sign in to comment.