mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-07 09:45:04 +08:00
style: include IT_NO_SUCH_ELEMENT
(#5200)
This commit is contained in:
@ -77,9 +77,6 @@
|
||||
<Match>
|
||||
<Bug pattern="UWF_UNWRITTEN_FIELD" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="IT_NO_SUCH_ELEMENT" />
|
||||
</Match>
|
||||
<Match>
|
||||
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
|
||||
</Match>
|
||||
|
@ -148,8 +148,11 @@ public class LinkedQueue<T> implements Iterable<T> {
|
||||
|
||||
@Override
|
||||
public T next() {
|
||||
node = node.next;
|
||||
return node.data;
|
||||
if (hasNext()) {
|
||||
node = node.next;
|
||||
return node.data;
|
||||
}
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user