mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 21:15:57 +01:00
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:
commit
6b16ed79b3
@ -353,9 +353,9 @@ public <T extends Flag<V>, V> V getFlag(T flag, LocalPlayer groupPlayer) {
|
|||||||
lastPriority = region.getPriority();
|
lastPriority = region.getPriority();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (!needsClear.isEmpty()) {
|
||||||
return needsClear.values().iterator().next();
|
return needsClear.values().iterator().next();
|
||||||
} catch (NoSuchElementException e) {
|
} else {
|
||||||
if (globalRegion != null) {
|
if (globalRegion != null) {
|
||||||
V gFlag = globalRegion.getFlag(flag);
|
V gFlag = globalRegion.getFlag(flag);
|
||||||
if (gFlag != null) return gFlag;
|
if (gFlag != null) return gFlag;
|
||||||
|
Loading…
Reference in New Issue
Block a user