Skip to content

Commit

Permalink
Small fix in PairHashSet.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
notgiven688 committed Dec 18, 2024
1 parent e469dd9 commit 07ce495
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Jitter2/Collision/PairHashSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ private void Resize(int size)
public bool Add(Pair pair)
{
int hash = pair.GetHash();
bool overwriteResult = false;

try_again:

Expand All @@ -193,7 +194,7 @@ public bool Add(Pair pair)

if (slotPtr->ID == pair.ID)
{
return false;
return overwriteResult;
}

if (slotPtr->ID == 0)
Expand All @@ -204,6 +205,7 @@ public bool Add(Pair pair)
if (originalSlots != Slots)
{
// Item was added to the wrong array.
overwriteResult = true;
goto try_again;
}

Expand Down

0 comments on commit 07ce495

Please sign in to comment.