Skip to content

Commit 223580a

Browse files
committed
MagicNumber to constants
1 parent 8617eeb commit 223580a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LLama/Batched/BatchedExecutor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public sealed class BatchedExecutor
1919
private int _batchQueueHead;
2020
private int _batchedTokenCount;
2121
private bool _batchedTokenCountDirty = true;
22+
private const int CleanupThreshold = 16;
2223

2324
/// <summary>
2425
/// Set to 1 using interlocked exchange while inference is running
@@ -216,7 +217,7 @@ void CleanupQueue()
216217
return;
217218
}
218219

219-
if (_batchQueueHead > 16 && _batchQueueHead > _batchQueue.Count / 2)
220+
if (_batchQueueHead > CleanupThreshold && _batchQueueHead > _batchQueue.Count / 2)
220221
{
221222
_batchQueue.RemoveRange(0, _batchQueueHead);
222223
_batchQueueHead = 0;

0 commit comments

Comments
 (0)