Fix unnecessary leaderboard entry position bumping#175
Conversation
|
This fix is correct and the logic is sound. A few observations: 🔵 Minor: Loop bumps entries beyond the collision unnecessarilyThe new loop runs from For example: entries
The old // Only bump entries that are contiguous with the collision
for (int i = collisionIndex; i < entries.Count; i++)
{
if (entries[i].id == upsertEntry.id) continue;
if (i > collisionIndex && entries[i].position != entries[i - 1].position + 1) break;
entries[i].position += 1;
}Whether that scope belongs in this PR is a judgment call — the stated fix (no-bump on same-position improvement) is correct as-is. 🔵 Minor: Missing test for a displaced entry scenarioThe new test only covers the "no collision" path. There is no test verifying that entries at positions above the collision are (or are not) bumped when a genuine displacement occurs. The existing Overall the core fix — using |
5156299 to
2a71cd7
Compare
No description provided.