247 |
|
} |
248 |
|
|
249 |
|
public E pollFirst() { |
250 |
< |
int h = head; |
250 |
> |
final Object[] elements = this.elements; |
251 |
> |
final int h = head; |
252 |
|
@SuppressWarnings("unchecked") |
253 |
|
E result = (E) elements[h]; |
254 |
|
// Element is null if deque empty |
260 |
|
} |
261 |
|
|
262 |
|
public E pollLast() { |
263 |
< |
int t = (tail - 1) & (elements.length - 1); |
263 |
> |
final Object[] elements = this.elements; |
264 |
> |
final int t = (tail - 1) & (elements.length - 1); |
265 |
|
@SuppressWarnings("unchecked") |
266 |
|
E result = (E) elements[t]; |
267 |
|
if (result != null) { |