forked from I2P_Developers/i2p.i2p
Clean up code
This commit is contained in:
@@ -44,7 +44,7 @@ import net.i2p.util.Log;
|
||||
public class CachedIteratorCollection<E> extends AbstractCollection<E> {
|
||||
|
||||
// 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<E> extends AbstractCollection<E> {
|
||||
final Node<E> 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<E> extends AbstractCollection<E> {
|
||||
this.last = null;
|
||||
this.size = 0;
|
||||
iterator.reset();
|
||||
log.debug("CachedIteratorAbstractCollection: Cleared");
|
||||
//log.debug("CachedIteratorAbstractCollection: Cleared");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,7 +156,6 @@ public class CachedIteratorCollection<E> extends AbstractCollection<E> {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user