From f9d5d48a4d70dc4ac7bdcb51c3fd400f2e833497 Mon Sep 17 00:00:00 2001 From: slumlord Date: Tue, 7 Aug 2018 12:04:31 +0000 Subject: [PATCH] Clean up code --- .../net/i2p/router/util/CachedIteratorCollection.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/router/java/src/net/i2p/router/util/CachedIteratorCollection.java b/router/java/src/net/i2p/router/util/CachedIteratorCollection.java index 163edabe86..1f46d0ab5b 100644 --- a/router/java/src/net/i2p/router/util/CachedIteratorCollection.java +++ b/router/java/src/net/i2p/router/util/CachedIteratorCollection.java @@ -44,7 +44,7 @@ import net.i2p.util.Log; public class CachedIteratorCollection extends AbstractCollection { // FOR DEBUGGING & LOGGING PURPOSES - Log log = I2PAppContext.getGlobalContext().logManager().getLog(CachedIteratorCollection.class); + //Log log = I2PAppContext.getGlobalContext().logManager().getLog(CachedIteratorCollection.class); // Cached Iterator object private final CachedIterator iterator = new CachedIterator(); @@ -91,13 +91,12 @@ public class CachedIteratorCollection extends AbstractCollection { final Node newNode = new Node<>(last, element); if (this.size == 0) { this.first = newNode; - this.last = newNode; } else { this.last.next = newNode; - this.last = newNode; } + this.last = newNode; this.size++; - log.debug("CachedIteratorAbstractCollection: Element added"); + //log.debug("CachedIteratorAbstractCollection: Element added"); return true; } @@ -111,7 +110,7 @@ public class CachedIteratorCollection extends AbstractCollection { this.last = null; this.size = 0; iterator.reset(); - log.debug("CachedIteratorAbstractCollection: Cleared"); + //log.debug("CachedIteratorAbstractCollection: Cleared"); } /** @@ -157,7 +156,6 @@ public class CachedIteratorCollection extends AbstractCollection { if (itrIndexNode != null) { // The Node we are trying to remove is itrIndexNode.prev // Is there a Node before itrIndexNode.prev? - //if (itrIndexNode.prev != null && itrIndexNode.prev.prev != null) { if (itrIndexNode != first.next) { // Set current itrIndexNode's prev to Node N-2 itrIndexNode.prev = itrIndexNode.prev.prev;