Compilation warnings resolved
This commit is contained in:
1 parent
450701f800
commit
0951b442ae
7 files changed
+19
-19
No files matched your search
@@ -8,7 +8,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
//[Benchmark(Baseline = false)]
|
//[Benchmark(Baseline = false)]
|
||||||
public void Array_Count()
|
public void Array_Count()
|
||||||
{
|
{
|
||||||
var data = _testArray;
|
var data = TestObjects;
|
||||||
DoNothing(data.Length);
|
DoNothing(data.Length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
//[Benchmark(Baseline = true)]
|
//[Benchmark(Baseline = true)]
|
||||||
public void PooledList_Count()
|
public void PooledList_Count()
|
||||||
{
|
{
|
||||||
var data = _testPooledList;
|
var data = TestObjectsAsPooledList;
|
||||||
DoNothing(data.Count);
|
DoNothing(data.Count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
//[Benchmark(Baseline = false)]
|
//[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_Count()
|
public void RecyclableList_Count()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
DoNothing(data.Count);
|
DoNothing(data.Count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
public void PooledList_GetItem()
|
public void PooledList_GetItem()
|
||||||
{
|
{
|
||||||
var data = _testPooledList;
|
var data = TestObjectsAsPooledList;
|
||||||
var dataCount = TestObjectCount;
|
var dataCount = TestObjectCount;
|
||||||
for (var i = 0; i < dataCount; i++)
|
for (var i = 0; i < dataCount; i++)
|
||||||
{
|
{
|
||||||
@@ -51,7 +51,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[Benchmark(Baseline = false)]
|
[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_GetItem()
|
public void RecyclableList_GetItem()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
var dataCount = TestObjectCount;
|
var dataCount = TestObjectCount;
|
||||||
for (var i = 0; i < dataCount; i++)
|
for (var i = 0; i < dataCount; i++)
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[Benchmark(Baseline = false)]
|
[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_GetItem_AsSpan()
|
public void RecyclableList_GetItem_AsSpan()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
int blockSize = data.BlockSize;
|
int blockSize = data.BlockSize;
|
||||||
int nextItemBlockIndex = data.NextItemBlockIndex;
|
int nextItemBlockIndex = data.NextItemBlockIndex;
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[Benchmark(Baseline = false)]
|
[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_GetItem_AsArray()
|
public void RecyclableList_GetItem_AsArray()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
int blockSize = data.BlockSize;
|
int blockSize = data.BlockSize;
|
||||||
int nextItemBlockIndex = data.NextItemBlockIndex;
|
int nextItemBlockIndex = data.NextItemBlockIndex;
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[Benchmark(Baseline = false)]
|
[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_GetItem_AsForEach()
|
public void RecyclableList_GetItem_AsForEach()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
var dataCount = TestObjectCount;
|
var dataCount = TestObjectCount;
|
||||||
|
|
||||||
foreach (var item in data)
|
foreach (var item in data)
|
||||||
@@ -130,7 +130,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[Benchmark(Baseline = false)]
|
[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_GetItem_AsWhile()
|
public void RecyclableList_GetItem_AsWhile()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
long dataCount = TestObjectCount;
|
long dataCount = TestObjectCount;
|
||||||
if (dataCount == 0)
|
if (dataCount == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
//[Benchmark(Baseline = false)]
|
//[Benchmark(Baseline = false)]
|
||||||
public void Array_LongCount()
|
public void Array_LongCount()
|
||||||
{
|
{
|
||||||
var data = _testArray;
|
var data = TestObjects;
|
||||||
DoNothing(data.LongLength);
|
DoNothing(data.LongLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
//[Benchmark(Baseline = false)]
|
//[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_LongCount()
|
public void RecyclableList_LongCount()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
DoNothing(data.LongCount);
|
DoNothing(data.LongCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
[MemoryDiagnoser]
|
[MemoryDiagnoser]
|
||||||
public partial class RecyclableCollectionsBenchmarks : BenchmarkBase
|
public partial class RecyclableCollectionsBenchmarks : BenchmarkBase
|
||||||
{
|
{
|
||||||
private long[] _testArray;
|
private long[]? _testArray;
|
||||||
private RecyclableArrayList<long> _testRecyclableArrayList;
|
private RecyclableArrayList<long>? _testRecyclableArrayList;
|
||||||
private RecyclableList<long> _testRecyclableList;
|
private RecyclableList<long>? _testRecyclableList;
|
||||||
private PooledList<long> _testPooledList;
|
private PooledList<long>? _testPooledList;
|
||||||
|
|
||||||
public PooledList<long> TestObjectsAsPooledList => _testPooledList ?? throw new NullReferenceException("Something is wrong and the field is not initialized");
|
public PooledList<long> TestObjectsAsPooledList => _testPooledList ?? throw new NullReferenceException("Something is wrong and the field is not initialized");
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
//[Benchmark(Baseline = true)]
|
//[Benchmark(Baseline = true)]
|
||||||
public void PooledList_SetItem()
|
public void PooledList_SetItem()
|
||||||
{
|
{
|
||||||
var data = _testPooledList;
|
var data = TestObjectsAsPooledList;
|
||||||
var dataCount = TestObjectCount;
|
var dataCount = TestObjectCount;
|
||||||
for (var i = 0; i < dataCount; i++)
|
for (var i = 0; i < dataCount; i++)
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ namespace Recyclable.Collections.Benchmarks
|
|||||||
//[Benchmark(Baseline = false)]
|
//[Benchmark(Baseline = false)]
|
||||||
public void RecyclableList_SetItem()
|
public void RecyclableList_SetItem()
|
||||||
{
|
{
|
||||||
var data = _testRecyclableList;
|
var data = TestObjectsAsRecyclableList;
|
||||||
var dataCount = TestObjectCount;
|
var dataCount = TestObjectCount;
|
||||||
for (var i = 0; i < dataCount; i++)
|
for (var i = 0; i < dataCount; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1277,7 +1277,7 @@ namespace Recyclable.Collections.Benchmarks.POC
|
|||||||
|
|
||||||
_blockSizePow2Shift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize));
|
_blockSizePow2Shift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize));
|
||||||
_capacity = Resize(this, minBlockSize, _blockSizePow2Shift, expectedItemsCount.Value);
|
_capacity = Resize(this, minBlockSize, _blockSizePow2Shift, expectedItemsCount.Value);
|
||||||
if (_memoryBlocks?.Length > 0 && minBlockSize != _memoryBlocks[0].Length)
|
if (_memoryBlocks!.Length > 0 && minBlockSize != _memoryBlocks[0].Length)
|
||||||
{
|
{
|
||||||
_blockSize = _memoryBlocks[0].Length;
|
_blockSize = _memoryBlocks[0].Length;
|
||||||
_blockSizePow2Shift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize));
|
_blockSizePow2Shift = (byte)(31 - BitOperations.LeadingZeroCount((uint)minBlockSize));
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
public void BeginUpdate() => _isUpdating++;
|
public void BeginUpdate() => _isUpdating++;
|
||||||
|
|
||||||
public void Clear()
|
public new void Clear()
|
||||||
{
|
{
|
||||||
BeginUpdate();
|
BeginUpdate();
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in new issue
Block a user