Skip to content

Commit

Permalink
Remove redundant clause in if statement for resets
Browse files Browse the repository at this point in the history
Summary: `stream.finalReadOffset` is a `folly::Optional` that we're setting with an actual value right before the statement in which I'm making the modification.

Reviewed By: hanidamlaj

Differential Revision: D65213768

fbshipit-source-id: 4c95ec8dc03fef69e974d4131ce6f98262151c02
  • Loading branch information
Aman Sharma authored and facebook-github-bot committed Oct 31, 2024
1 parent 3024650 commit 77dba40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions quic/state/stream/StreamStateFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ void onResetQuicStream(QuicStreamState& stream, const RstStreamFrame& frame) {
stream.readBuffer.clear();
stream.finalReadOffset = frame.offset;
stream.streamReadError = frame.errorCode;
bool appReadAllBytes = stream.finalReadOffset &&
stream.currentReadOffset > *stream.finalReadOffset;
bool appReadAllBytes = stream.currentReadOffset > *stream.finalReadOffset;
if (!appReadAllBytes) {
// If the currentReadOffset > finalReadOffset we have already processed
// all the bytes until FIN, so we don't need to do anything for the read
Expand Down

0 comments on commit 77dba40

Please sign in to comment.