diff --git a/src/NexusMods.MnemonicDB.Abstractions/Attributes/CollectionAttribute.cs b/src/NexusMods.MnemonicDB.Abstractions/Attributes/CollectionAttribute.cs index 96d8e9a0..8de2a92c 100644 --- a/src/NexusMods.MnemonicDB.Abstractions/Attributes/CollectionAttribute.cs +++ b/src/NexusMods.MnemonicDB.Abstractions/Attributes/CollectionAttribute.cs @@ -25,7 +25,7 @@ public Values Get(IEntity ent) if (datom.A != dbId) continue; var start = i; - while (i < segment.Count - 1 && segment[i].A == dbId) + while (i < segment.Count && segment[i].A == dbId) { i++; } diff --git a/src/NexusMods.MnemonicDB.Abstractions/IndexSegments/Values.cs b/src/NexusMods.MnemonicDB.Abstractions/IndexSegments/Values.cs index 89261856..03fe5108 100644 --- a/src/NexusMods.MnemonicDB.Abstractions/IndexSegments/Values.cs +++ b/src/NexusMods.MnemonicDB.Abstractions/IndexSegments/Values.cs @@ -36,7 +36,7 @@ public TValueType[] ToArray() /// public IEnumerator GetEnumerator() { - for (var i = start; i < end; i++) + for (var i = 0; i < Count; i++) { yield return this[i]; }