mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 19:25:15 +01:00
Avoid exception try-catch on nominal path
This commit is contained in:
parent
4cb5b9a956
commit
55720cfd4d
@ -30,15 +30,10 @@ public class AsynchronousQueue<T> {
|
||||
|
||||
private T pop() {
|
||||
synchronized (lock) {
|
||||
try {
|
||||
T t = queue.removeFirst();
|
||||
if (!set.remove(t)) {
|
||||
// This should never happen.
|
||||
}
|
||||
return t;
|
||||
} catch (NoSuchElementException e) {
|
||||
return null;
|
||||
}
|
||||
T t = queue.pollFirst();
|
||||
if(t != null)
|
||||
set.remove(t);
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user