You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/06/17 15:32:18 UTC

[commons-collections] branch master updated: Merge conditions using the same blocks.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new 10f1f97  Merge conditions using the same blocks.
10f1f97 is described below

commit 10f1f977ddcda9a10dbd69ce0e461e58227d6f16
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Jun 17 11:32:10 2020 -0400

    Merge conditions using the same blocks.
---
 .../org/apache/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 5349c87..31b665a 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<E> extends AbstractLinkedList<E> implements Se
          * @param node  the node that was added
          */
         protected void nodeInserted(final Node<E> node) {
-            if (node.previous == current) {
-                next = node;
-            } else if (next.previous == node) {
+            if ((node.previous == current) || (next.previous == node)) {
                 next = node;
             } else {
                 nextIndexValid = false;