Skip to content

Commit f26cca5

Browse files
committed
Avoid casting twice
1 parent 3732425 commit f26cca5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/EncodeTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ public void EncodeOverflowing()
9494

9595
// Console.WriteLine($"Text: {text}");
9696

97-
var expectedTotalIDLength = expectedMaxInputLength * (numOverflowingTokensSegments + 1);
97+
var expectedTotalIDLength = (int) (expectedMaxInputLength * (numOverflowingTokensSegments + 1));
9898

99-
var ids = new List<uint>((int) expectedTotalIDLength);
99+
var ids = new List<uint>(expectedTotalIDLength);
100100

101101
ids.AddRange(tokenizeResult.IDs.AsReadOnlySpan());
102102

@@ -113,7 +113,7 @@ public void EncodeOverflowing()
113113
// Console.WriteLine(overflowingToken.IDs.AsReadOnlySpan().GetSpanPrintString());
114114
}
115115

116-
ids.Count.Should().Be((int) expectedTotalIDLength);
116+
ids.Count.Should().Be(expectedTotalIDLength);
117117

118118
using var decodeOutput = tokenizer.Decode(CollectionsMarshal.AsSpan(ids), skipSpecialTokens: true);
119119

0 commit comments

Comments
 (0)