Add SparseSet Test

This commit is contained in:
2025-12-13 18:26:59 +09:00
parent c882c75760
commit 3016696d76
8 changed files with 85 additions and 16 deletions

View File

@@ -80,6 +80,7 @@ public unsafe struct UnsafeArray<T> : IUnsafeCollection<T>
private AllocationHandle _allocationHandle;
public readonly int Count => _count;
public readonly int Length => _count;
public readonly ref T this[int index]
{

View File

@@ -54,7 +54,7 @@ public unsafe struct UnsafeSlotMap<T> : IUnsafeCollection<T>
public Enumerator(UnsafeSlotMap<T>* collection)
{
_collection = collection;
_currentIndex = -1;
_currentIndex = 0;
}
public bool MoveNext()
@@ -65,7 +65,7 @@ public unsafe struct UnsafeSlotMap<T> : IUnsafeCollection<T>
public void Reset()
{
_currentIndex = -1;
_currentIndex = 0;
}
public void Dispose()
@@ -302,6 +302,8 @@ public unsafe struct UnsafeSlotMap<T> : IUnsafeCollection<T>
_validBits.ClearAll();
_count = 0;
Add(default, out _);
}
public readonly void* GetUnsafePtr()

View File

@@ -56,7 +56,7 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
public Enumerator(UnsafeSparseSet<T>* collection)
{
_collection = collection;
_currentIndex = -1;
_currentIndex = 0;
}
public bool MoveNext()
@@ -67,10 +67,10 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
public void Reset()
{
_currentIndex = -1;
_currentIndex = 0;
}
public readonly unsafe void Dispose()
public readonly void Dispose()
{
}
}
@@ -345,6 +345,8 @@ public unsafe struct UnsafeSparseSet<T> : IUnsafeCollection<T>
_count = 0;
_nextId = 0;
Add(default, out _);
}
/// <inheritdoc/>