Browse Source

Fixed eager count check

tags/v0.4.2-preview
Martin Evans 2 years ago
parent
commit
3d07721a00
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      LLama/Common/FixedSizeQueue.cs

+ 1
- 1
LLama/Common/FixedSizeQueue.cs View File

@@ -31,7 +31,7 @@ namespace LLama.Common
public FixedSizeQueue(int size, IEnumerable<T> data)
{
// Try an early check on the amount of data supplied (if possible)
if (data.TryGetNonEnumeratedCount(out var count))
if (data.TryGetNonEnumeratedCount(out var count) && count > size)
throw new ArgumentException($"The max size set for the quene is {size}, but got {count} initial values.");

// Size of "data" is unknown, copy it all into a list


Loading…
Cancel
Save