Skip to content

Commit

Permalink
Assign opIndex only if needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
koculu committed Oct 16, 2024
1 parent 61c82cc commit 99199b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ZoneTree/Segments/InMemory/MutableSegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,18 @@ public AddOrUpdateResult Delete(in TKey key, out long opIndex)
try
{
Interlocked.Increment(ref WritesInProgress);
opIndex = 0;

if (IsFrozenFlag)
{
opIndex = 0;
return AddOrUpdateResult.RETRY_SEGMENT_IS_FROZEN;
}

if (BTree.Length >= MutableSegmentMaxItemCount)
{
opIndex = 0;
return AddOrUpdateResult.RETRY_SEGMENT_IS_FULL;
}

TValue insertedValue = default;

Expand Down

0 comments on commit 99199b1

Please sign in to comment.