mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-17 22:24:22 +01:00
bugfix: prevent skipping over 1
Maintainers expect _currentCollectionIdValue to start at 1, and I don't want to change that
This commit is contained in:
parent
1d7603bb8c
commit
cc95678d05
1 changed files with 6 additions and 2 deletions
|
|
@ -90,7 +90,11 @@ public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable, ISer
|
||||||
public LocalCollectionId CurrentCollectionId => new(_currentCollectionIdValue);
|
public LocalCollectionId CurrentCollectionId => new(_currentCollectionIdValue);
|
||||||
|
|
||||||
private LocalCollectionId AllocateNextId ()
|
private LocalCollectionId AllocateNextId ()
|
||||||
=> new(Interlocked.Increment(ref _currentCollectionIdValue));
|
{
|
||||||
|
var newLocalId = new LocalCollectionId(_currentCollectionIdValue);
|
||||||
|
Interlocked.Increment(ref _currentCollectionIdValue);
|
||||||
|
return newLocalId;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary> Default enumeration skips the empty collection. </summary>
|
/// <summary> Default enumeration skips the empty collection. </summary>
|
||||||
public IEnumerator<ModCollection> GetEnumerator()
|
public IEnumerator<ModCollection> GetEnumerator()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue