Skip to content

Commit c694dc7

Browse files
Sync shared code from runtime (#42276)
Co-authored-by: Tratcher <[email protected]>
1 parent 10b1fd9 commit c694dc7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Shared/runtime/Http2/Hpack/IntegerDecoder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ public bool TryDecode(byte b, out int result)
7373
throw new HPackDecodingException(SR.net_http_hpack_bad_integer);
7474
}
7575

76-
_i = _i + ((b & 0x7f) << _m);
76+
_i += ((b & 0x7f) << _m);
7777

7878
// If the addition overflowed, the result will be negative.
7979
if (_i < 0)
8080
{
8181
throw new HPackDecodingException(SR.net_http_hpack_bad_integer);
8282
}
8383

84-
_m = _m + 7;
84+
_m += 7;
8585

8686
if ((b & 128) == 0)
8787
{

src/Shared/runtime/Http2/Hpack/IntegerEncoder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static bool Encode(int value, int numBits, Span<byte> destination, out in
5050
return false;
5151
}
5252

53-
value = value - ((1 << numBits) - 1);
53+
value -= ((1 << numBits) - 1);
5454
int i = 1;
5555

5656
while (value >= 128)
@@ -63,7 +63,7 @@ public static bool Encode(int value, int numBits, Span<byte> destination, out in
6363
return false;
6464
}
6565

66-
value = value / 128;
66+
value /= 128;
6767
}
6868
destination[i++] = (byte)value;
6969

0 commit comments

Comments
 (0)