diff --git a/src/main/java/uta/cse3310/Leaderboard.java b/src/main/java/uta/cse3310/Leaderboard.java index d781c2c..bddfea6 100644 --- a/src/main/java/uta/cse3310/Leaderboard.java +++ b/src/main/java/uta/cse3310/Leaderboard.java @@ -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.length()) + if(scores.indexOf(score) > names.size()) { names.add(handle); } @@ -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.length()) + if(scores.indexOf(new_score) > names.size()) { names.add(handle); }