Useless else statements.

This commit is contained in:
GJ 2013-01-21 17:15:53 -05:00
parent 9512879cc7
commit 900623461a
2 changed files with 49 additions and 48 deletions

View File

@ -119,17 +119,19 @@ public enum SkillType {
} }
public static SkillType getSkill(String skillName) { public static SkillType getSkill(String skillName) {
if(skillName.equalsIgnoreCase("powerlevel") || skillName.equalsIgnoreCase("all")) { if (skillName.equalsIgnoreCase("powerlevel") || skillName.equalsIgnoreCase("all")) {
return SkillType.ALL; return SkillType.ALL;
} else {
for(SkillType st : SkillType.values()) {
if(st.name().equalsIgnoreCase(skillName))
return st;
} }
System.out.println("[DEBUG] Invalid mcMMO skill ("+skillName+")");
for (SkillType type : SkillType.values()) {
if (type.name().equalsIgnoreCase(skillName)) {
return type;
}
}
System.out.println("[DEBUG] Invalid mcMMO skill (" + skillName + ")");
return null; return null;
} }
}
/** /**
* Get the skill level for this skill. * Get the skill level for this skill.

View File

@ -211,20 +211,19 @@ public class Leaderboard {
int currentPos = 1; int currentPos = 1;
List<PlayerStat> statsList = playerStatHash.get(skillType); List<PlayerStat> statsList = playerStatHash.get(skillType);
if(statsList != null) { if (statsList != null) {
for(PlayerStat ps : statsList) { for (PlayerStat stat : statsList) {
if(ps.name.equalsIgnoreCase(playerName)) { if (stat.name.equalsIgnoreCase(playerName)) {
return new int[] {currentPos, ps.statVal}; return new int[] {currentPos, stat.statVal};
} else { }
currentPos++; currentPos++;
continue; continue;
} }
return new int[] {0};
} }
return new int[] {0}; return new int[] {0};
} else {
return new int[] {0};
}
} }
private static class SkillComparator implements Comparator<PlayerStat> { private static class SkillComparator implements Comparator<PlayerStat> {