mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-13 12:14:17 +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
|
|
@ -89,8 +89,12 @@ public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable, ISer
|
|||
/// <remarks> Starts at 1 because the empty collection gets Zero. </remarks>
|
||||
public LocalCollectionId CurrentCollectionId => new(_currentCollectionIdValue);
|
||||
|
||||
private LocalCollectionId AllocateNextId ()
|
||||
=> new(Interlocked.Increment(ref _currentCollectionIdValue));
|
||||
private LocalCollectionId AllocateNextId ()
|
||||
{
|
||||
var newLocalId = new LocalCollectionId(_currentCollectionIdValue);
|
||||
Interlocked.Increment(ref _currentCollectionIdValue);
|
||||
return newLocalId;
|
||||
}
|
||||
|
||||
/// <summary> Default enumeration skips the empty collection. </summary>
|
||||
public IEnumerator<ModCollection> GetEnumerator()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue