Skip to content

Commit 63c63ea

Browse files
Sync shared code from runtime (#42288)
Co-authored-by: Tratcher <[email protected]>
1 parent 2ed3a64 commit 63c63ea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Shared/runtime/Http3/Helpers/VariableLengthIntegerHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static bool TryReadSlow(ref SequenceReader<byte> reader, out long value)
115115
if (reader.TryCopyTo(temp))
116116
{
117117
bool result = TryRead(temp, out value, out int bytesRead);
118-
Debug.Assert(result == true);
118+
Debug.Assert(result);
119119
Debug.Assert(bytesRead == length);
120120

121121
reader.Advance(bytesRead);
@@ -190,7 +190,7 @@ public static bool TryWrite(Span<byte> buffer, long longToEncode, out int bytesW
190190
public static int WriteInteger(Span<byte> buffer, long longToEncode)
191191
{
192192
bool res = TryWrite(buffer, longToEncode, out int bytesWritten);
193-
Debug.Assert(res == true);
193+
Debug.Assert(res);
194194
return bytesWritten;
195195
}
196196

src/Shared/runtime/Http3/QPack/QPackEncoder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static byte[] EncodeStaticIndexedHeaderFieldToArray(int index)
3838
Span<byte> buffer = stackalloc byte[IntegerEncoder.MaxInt32EncodedLength];
3939

4040
bool res = EncodeStaticIndexedHeaderField(index, buffer, out int bytesWritten);
41-
Debug.Assert(res == true);
41+
Debug.Assert(res);
4242

4343
return buffer.Slice(0, bytesWritten).ToArray();
4444
}
@@ -93,7 +93,7 @@ public static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int
9393

9494
temp[0] = 0b01110000;
9595
bool res = IntegerEncoder.Encode(index, 4, temp, out int headerBytesWritten);
96-
Debug.Assert(res == true);
96+
Debug.Assert(res);
9797

9898
return temp.Slice(0, headerBytesWritten).ToArray();
9999
}
@@ -102,7 +102,7 @@ public static byte[] EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(int
102102
{
103103
Span<byte> temp = value.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[value.Length + IntegerEncoder.MaxInt32EncodedLength * 2];
104104
bool res = EncodeLiteralHeaderFieldWithStaticNameReference(index, value, temp, out int bytesWritten);
105-
Debug.Assert(res == true);
105+
Debug.Assert(res);
106106
return temp.Slice(0, bytesWritten).ToArray();
107107
}
108108

@@ -168,7 +168,7 @@ public static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string
168168
Span<byte> temp = name.Length < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength] : new byte[name.Length + IntegerEncoder.MaxInt32EncodedLength];
169169

170170
bool res = EncodeNameString(name, temp, out int nameLength);
171-
Debug.Assert(res == true);
171+
Debug.Assert(res);
172172

173173
return temp.Slice(0, nameLength).ToArray();
174174
}
@@ -178,7 +178,7 @@ public static byte[] EncodeLiteralHeaderFieldWithoutNameReferenceToArray(string
178178
Span<byte> temp = (name.Length + value.Length) < 256 ? stackalloc byte[256 + IntegerEncoder.MaxInt32EncodedLength * 2] : new byte[name.Length + value.Length + IntegerEncoder.MaxInt32EncodedLength * 2];
179179

180180
bool res = EncodeLiteralHeaderFieldWithoutNameReference(name, value, temp, out int bytesWritten);
181-
Debug.Assert(res == true);
181+
Debug.Assert(res);
182182

183183
return temp.Slice(0, bytesWritten).ToArray();
184184
}

0 commit comments

Comments
 (0)