From 10f1f977ddcda9a10dbd69ce0e461e58227d6f16 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Wed, 17 Jun 2020 11:32:10 -0400 Subject: [PATCH] Merge conditions using the same blocks. --- .../commons/collections4/list/CursorableLinkedList.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java index 5349c87fc..31b665a34 100644 --- a/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java +++ b/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java @@ -535,9 +535,7 @@ public class CursorableLinkedList extends AbstractLinkedList implements Se * @param node the node that was added */ protected void nodeInserted(final Node node) { - if (node.previous == current) { - next = node; - } else if (next.previous == node) { + if ((node.previous == current) || (next.previous == node)) { next = node; } else { nextIndexValid = false;