Move siblings to the top of the list when accessed
This commit is contained in:
parent
ca09e7f537
commit
e03da15449
1 changed files with 8 additions and 3 deletions
|
@ -121,11 +121,16 @@ namespace Ryujinx.Graphics
|
||||||
|
|
||||||
private LinkedList<TValue> GetOrAddEntry(TKey Params)
|
private LinkedList<TValue> GetOrAddEntry(TKey Params)
|
||||||
{
|
{
|
||||||
foreach ((TKey MyParams, LinkedList<TValue> Resources) in Entries)
|
foreach ((TKey MyParams, LinkedList<TValue> Resources) Tuple in Entries)
|
||||||
{
|
{
|
||||||
if (MyParams.IsCompatible(Params))
|
if (Tuple.MyParams.IsCompatible(Params))
|
||||||
{
|
{
|
||||||
return Resources;
|
//Move accessed siblings to the top of the list, for faster access in the future
|
||||||
|
Entries.Remove(Tuple);
|
||||||
|
|
||||||
|
Entries.AddFirst(Tuple);
|
||||||
|
|
||||||
|
return Tuple.Resources;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue