From 3d07721a00570a6468f13aed4fb6e56c04aaba5d Mon Sep 17 00:00:00 2001 From: Martin Evans Date: Mon, 24 Jul 2023 15:55:06 +0100 Subject: [PATCH] Fixed eager count check --- LLama/Common/FixedSizeQueue.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LLama/Common/FixedSizeQueue.cs b/LLama/Common/FixedSizeQueue.cs index d39c1f28..73dde213 100644 --- a/LLama/Common/FixedSizeQueue.cs +++ b/LLama/Common/FixedSizeQueue.cs @@ -31,7 +31,7 @@ namespace LLama.Common public FixedSizeQueue(int size, IEnumerable 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