Skip to content

Commit

Permalink
SparseCache: fix bug in tryGet method
Browse files Browse the repository at this point in the history
update currChunkIndex_ when the chunk is found
fixes #366
  • Loading branch information
Grok Compression committed Sep 11, 2024
1 parent a77ede1 commit a8d193b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/core/cache/SparseCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,14 @@ class SparseCache
{
auto iter = chunks.find(chunkIndex);
if(iter != chunks.end())
{
currChunk_ = iter->second;
currChunkIndex_ = chunkIndex; // Update currChunkIndex_ when the chunk is found
}
else
{
return nullptr;
}
}
return currChunk_[itemIndex];
}
Expand Down

0 comments on commit a8d193b

Please sign in to comment.