diff --git a/src/ZoneTree.UnitTests/SafeBplusTreeTests.cs b/src/ZoneTree.UnitTests/SafeBplusTreeTests.cs index ad5c4a6..a6f8ac3 100644 --- a/src/ZoneTree.UnitTests/SafeBplusTreeTests.cs +++ b/src/ZoneTree.UnitTests/SafeBplusTreeTests.cs @@ -148,15 +148,13 @@ public void BTreeIteratorParallelInserts(BTreeLockMode lockMode) { var key = random.Next(); tree.AddOrUpdate(key, - AddOrUpdateResult (ref int value) => + void (ref int value) => { value = key + key; - return AddOrUpdateResult.ADDED; }, - AddOrUpdateResult (ref int value) => + void (ref int value) => { value = key + key; - return AddOrUpdateResult.UPDATED; }, out _); }); }); @@ -203,15 +201,13 @@ public void BTreeReverseIteratorParallelInserts(BTreeLockMode lockMode) { var key = random.Next(); tree.AddOrUpdate(key, - AddOrUpdateResult (ref int x) => + void (ref int x) => { x = key + key; - return AddOrUpdateResult.ADDED; }, - AddOrUpdateResult (ref int y) => + void (ref int y) => { y = key + key; - return AddOrUpdateResult.UPDATED; }, out _); }); }); diff --git a/src/ZoneTree/Collections/BTree/BTree.Write.cs b/src/ZoneTree/Collections/BTree/BTree.Write.cs index 6a1f816..3918c4b 100644 --- a/src/ZoneTree/Collections/BTree/BTree.Write.cs +++ b/src/ZoneTree/Collections/BTree/BTree.Write.cs @@ -95,9 +95,9 @@ public bool TryInsert(in TKey key, in TValue value, out long opIndex) } } - public delegate AddOrUpdateResult AddDelegate(ref TValue value); + public delegate void AddDelegate(ref TValue value); - public delegate AddOrUpdateResult UpdateDelegate(ref TValue value); + public delegate void UpdateDelegate(ref TValue value); public AddOrUpdateResult AddOrUpdate( in TKey key, diff --git a/src/ZoneTree/Segments/InMemory/MutableSegment.cs b/src/ZoneTree/Segments/InMemory/MutableSegment.cs index 1e80d9b..89671dd 100644 --- a/src/ZoneTree/Segments/InMemory/MutableSegment.cs +++ b/src/ZoneTree/Segments/InMemory/MutableSegment.cs @@ -224,17 +224,15 @@ public AddOrUpdateResult Delete(in TKey key, out long opIndex) var status = BTree .AddOrUpdate(key, - AddOrUpdateResult (ref TValue x) => + void (ref TValue x) => { MarkValueDeleted(ref x); insertedValue = x; - return AddOrUpdateResult.ADDED; }, - AddOrUpdateResult (ref TValue x) => + void (ref TValue x) => { MarkValueDeleted(ref x); insertedValue = x; - return AddOrUpdateResult.UPDATED; }, out opIndex); WriteAheadLog.Append(in key, in insertedValue, opIndex); return status;