Merge conditions using the same blocks.

This commit is contained in:
Gary Gregory 2020-06-17 11:32:10 -04:00
parent 6b4d75f725
commit 10f1f977dd
1 changed files with 1 additions and 3 deletions

View File

@ -535,9 +535,7 @@ public class CursorableLinkedList<E> extends AbstractLinkedList<E> implements Se
* @param node the node that was added * @param node the node that was added
*/ */
protected void nodeInserted(final Node<E> node) { protected void nodeInserted(final Node<E> node) {
if (node.previous == current) { if ((node.previous == current) || (next.previous == node)) {
next = node;
} else if (next.previous == node) {
next = node; next = node;
} else { } else {
nextIndexValid = false; nextIndexValid = false;