Commit 6e7ef22c authored by cmasone's avatar cmasone Committed by Commit bot

Remove trivially-true checks in quic_framer.cc

There were several places in this file where an error code value
was checked to see if it was less than QUIC_NO_ERROR or
QUIC_STREAM_NO_ERROR, which are both 0. On some compilers this
causes a warning, because such checks are trivially true.

BUG=424334
TEST=net_unittests
R=rch@chromium.org

Review URL: https://codereview.chromium.org/662513007

Cr-Commit-Position: refs/heads/master@{#300368}
parent 8c47ff67
...@@ -1528,8 +1528,7 @@ bool QuicFramer::ProcessRstStreamFrame(QuicRstStreamFrame* frame) { ...@@ -1528,8 +1528,7 @@ bool QuicFramer::ProcessRstStreamFrame(QuicRstStreamFrame* frame) {
return false; return false;
} }
if (error_code >= QUIC_STREAM_LAST_ERROR || if (error_code >= QUIC_STREAM_LAST_ERROR) {
error_code < QUIC_STREAM_NO_ERROR) {
set_detailed_error("Invalid rst stream error code."); set_detailed_error("Invalid rst stream error code.");
return false; return false;
} }
...@@ -1553,8 +1552,7 @@ bool QuicFramer::ProcessConnectionCloseFrame(QuicConnectionCloseFrame* frame) { ...@@ -1553,8 +1552,7 @@ bool QuicFramer::ProcessConnectionCloseFrame(QuicConnectionCloseFrame* frame) {
return false; return false;
} }
if (error_code >= QUIC_LAST_ERROR || if (error_code >= QUIC_LAST_ERROR) {
error_code < QUIC_NO_ERROR) {
set_detailed_error("Invalid error code."); set_detailed_error("Invalid error code.");
return false; return false;
} }
...@@ -1579,8 +1577,7 @@ bool QuicFramer::ProcessGoAwayFrame(QuicGoAwayFrame* frame) { ...@@ -1579,8 +1577,7 @@ bool QuicFramer::ProcessGoAwayFrame(QuicGoAwayFrame* frame) {
} }
frame->error_code = static_cast<QuicErrorCode>(error_code); frame->error_code = static_cast<QuicErrorCode>(error_code);
if (error_code >= QUIC_LAST_ERROR || if (error_code >= QUIC_LAST_ERROR) {
error_code < QUIC_NO_ERROR) {
set_detailed_error("Invalid error code."); set_detailed_error("Invalid error code.");
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment