Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Wsm2110 committed Jun 8, 2024
1 parent a1b53b9 commit 21d4af9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Concurrent/CMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ public bool Emplace(TKey key, TValue value)
index &= table.LengthMinusOne; // Ensure the index is within table bounds
} while (true); // Continue retrying until insertion is successful
}


/// <summary>
/// The Get method retrieves a value from a concurrent hash table based on a key.
Expand Down Expand Up @@ -467,7 +468,7 @@ public bool Remove(TKey key)
// reset current entry
entry.Meta = _tombstone;
entry.Key = default;
entry.Value = default;
entry.Value = default;

// Check if the table has been resized during the operation
if (_table != table)
Expand All @@ -478,13 +479,12 @@ public bool Remove(TKey key)
goto start;
}


entry.Exit();

Interlocked.Decrement(ref table._count);

return true;
}
}
}

// If the entry indicates an empty bucket, the key does not exist in the table
Expand Down

0 comments on commit 21d4af9

Please sign in to comment.