Isolated unchecked cast warning from FastQueue.poll()
This commit is contained in:
parent
6611563c8c
commit
597cbd870c
@ -55,7 +55,6 @@ public class FastQueue<E> {
|
|||||||
elements[size ++] = e;
|
elements[size ++] = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
public E poll() {
|
public E poll() {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (drainedElements == null) {
|
if (drainedElements == null) {
|
||||||
@ -72,11 +71,16 @@ public class FastQueue<E> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (index < drainedElementCount) {
|
if (index < drainedElementCount) {
|
||||||
return (E) drainedElements[index ++];
|
return cast(drainedElements[index ++]);
|
||||||
}
|
}
|
||||||
|
|
||||||
drainedElements = null;
|
drainedElements = null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private E cast(Object o) {
|
||||||
|
return (E) o;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user