Skip to content

Commit

Permalink
Avoid casting twice
Browse files Browse the repository at this point in the history
  • Loading branch information
budgetdevv committed Sep 24, 2024
1 parent 3732425 commit f26cca5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tests/EncodeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public void EncodeOverflowing()

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

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

var ids = new List<uint>((int) expectedTotalIDLength);
var ids = new List<uint>(expectedTotalIDLength);

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

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

ids.Count.Should().Be((int) expectedTotalIDLength);
ids.Count.Should().Be(expectedTotalIDLength);

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

Expand Down

0 comments on commit f26cca5

Please sign in to comment.