Merge pull request #298 from md-5/herd_u_like_ifs

Using checked exceptions for control flow is slow. Lets replace it with an isEmpty check.
This commit is contained in:
TomyLobo 2013-12-09 00:28:16 -08:00
commit 6b16ed79b3

View File

@ -353,9 +353,9 @@ public <T extends Flag<V>, V> V getFlag(T flag, LocalPlayer groupPlayer) {
lastPriority = region.getPriority();
}
try {
if (!needsClear.isEmpty()) {
return needsClear.values().iterator().next();
} catch (NoSuchElementException e) {
} else {
if (globalRegion != null) {
V gFlag = globalRegion.getFlag(flag);
if (gFlag != null) return gFlag;