mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
More efficient dictionary enumeration
This commit is contained in:
parent
3e0e2efde1
commit
bb84f9c927
@ -84,5 +84,14 @@
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override IEnumerator<AccessPair<TKey, TValue, TKeyBase, TValueBase>> GetEnumerator()
|
||||
{
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
yield return GetPair(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,13 +160,7 @@ namespace AssetRipper.Assets.Generics
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IEnumerator<AccessPairBase<TKey, TValue>> GetEnumerator()
|
||||
{
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
yield return GetPair(i);
|
||||
}
|
||||
}
|
||||
public abstract IEnumerator<AccessPairBase<TKey, TValue>> GetEnumerator();
|
||||
|
||||
/// <inheritdoc/>
|
||||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
|
||||
|
||||
@ -236,5 +236,14 @@
|
||||
|
||||
Capacity = (int)newcapacity;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override IEnumerator<AssetPair<TKey, TValue>> GetEnumerator()
|
||||
{
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
yield return pairs[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -500,7 +500,7 @@ namespace AssetRipper.Export.Modules.Shaders.IO
|
||||
{
|
||||
writer.WriteIndent(indent);
|
||||
writer.Write("Tags { ");
|
||||
foreach (AccessPairBase<Utf8String, Utf8String> kvp in _this.Tags)
|
||||
foreach (AssetPair<Utf8String, Utf8String> kvp in _this.Tags)
|
||||
{
|
||||
writer.Write($"\"{kvp.Key}\" = \"{kvp.Value}\" ");
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using AssetRipper.Primitives;
|
||||
using AssetRipper.SourceGenerated.Classes.ClassID_21;
|
||||
using AssetRipper.SourceGenerated.Classes.ClassID_21;
|
||||
using AssetRipper.SourceGenerated.Subclasses.UnityPropertySheet;
|
||||
using AssetRipper.SourceGenerated.Subclasses.UnityTexEnv;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user