Skip to content

Commit

Permalink
trying new method
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenttrinh3336 committed Apr 29, 2024
1 parent c209eaa commit b834aee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/uta/cse3310/Leaderboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void add(String handle, int score) {
LB.put(handle, score);
scores.add(score);
Collections.sort(scores);
if(scores.indexOf(score) > names.size())
if(scores.indexOf(score) >= names.size())
{
names.add(handle);
}
Expand All @@ -36,7 +36,7 @@ public void update(String handle, int score)
names.remove(handle);
scores.add(new_score);
Collections.sort(scores);
if(scores.indexOf(new_score) > names.size())
if(scores.indexOf(new_score) >= names.size())
{
names.add(handle);
}
Expand Down

0 comments on commit b834aee

Please sign in to comment.