MostRecentlyUsedCache
Closed this issue · 1 comments
MarkusTischendorf commented
Hi Matt,
i think there is an issue in the MastRecentlyUsedCache class in method Lookup.
The method is always returing the last query not the one it found:
for (int i = 0, n = this.list.Count; i < n; i++)
{
cached = this.list[i];
if (fnEquals(cached, item))
{
cacheIndex = 0;
}
}
I think this should be correct:
for (int i = 0, n = list.Count; i < n && cacheIndex < 0; i++)
{
cached = this.list[i];
if (_fnEquals(cached, item))
{
cacheIndex = i;
}
}
The for-loop is two times in that method.
Thanks and best regards,
Markus