mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-02-17 20:31:37 +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() {
|
private T pop() {
|
||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
try {
|
T t = queue.pollFirst();
|
||||||
T t = queue.removeFirst();
|
if(t != null)
|
||||||
if (!set.remove(t)) {
|
set.remove(t);
|
||||||
// This should never happen.
|
return t;
|
||||||
}
|
|
||||||
return t;
|
|
||||||
} catch (NoSuchElementException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user