Chromium Code Reviews| Index: net/http2/hpack/decoder/hpack_varint_decoder.h |
| diff --git a/net/http2/hpack/decoder/hpack_varint_decoder.h b/net/http2/hpack/decoder/hpack_varint_decoder.h |
| index b110fad23a983b40b0e7974e56bd43ca9bbf56e1..21d230371a56e94afc43b04f400e245ae44e9f4f 100644 |
| --- a/net/http2/hpack/decoder/hpack_varint_decoder.h |
| +++ b/net/http2/hpack/decoder/hpack_varint_decoder.h |
| @@ -95,13 +95,12 @@ class NET_EXPORT_PRIVATE HpackVarintDecoder { |
| return DecodeStatus::kDecodeInProgress; |
| } |
| uint8_t byte = db->DecodeUInt8(); |
| + if (offset_ == MaxOffset() && byte != 0) |
|
xunjieli
2017/04/17 20:51:34
Can we change this to a while-loop to be more read
|
| + break; |
| value_ += (byte & 0x7f) << offset_; |
| if ((byte & 0x80) == 0) { |
| - if (offset_ < MaxOffset() || byte == 0) { |
| - MarkDone(); |
| - return DecodeStatus::kDecodeDone; |
| - } |
| - break; |
| + MarkDone(); |
| + return DecodeStatus::kDecodeDone; |
| } |
| offset_ += 7; |
| } while (offset_ <= MaxOffset()); |