Skip to content

Commit d47d6ed

Browse files
author
MPCoreDeveloper
committed
fix(sonar): restructure S3267 index-loading loop
1 parent 1eda8dd commit d47d6ed

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/SharpCoreDB/DataStructures/Table.CRUD.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ public void Insert(Dictionary<string, object> row)
140140
{
141141
unloadedIndexes = [];
142142
// Manual loop for performance - avoids LINQ Where.ToList() allocation on hot path
143-
// NOSONAR:S3267 - intentional: LINQ Where would allocate on this hot path.
144143
foreach (var col in this.registeredIndexes.Keys)
145144
{
146-
if (!this.loadedIndexes.Contains(col))
145+
bool needsLoad = !this.loadedIndexes.Contains(col);
146+
if (needsLoad)
147147
{
148148
unloadedIndexes.Add(col);
149149
}

0 commit comments

Comments
 (0)