Github user dkuppitz commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/524#discussion_r94925652
--- Diff:
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/DedupGlobalStep.java
---
@@ -89,6 +92,17 @@ public ElementRequirement getMaxRequirement() {
@Override
protected Traverser.Admin<S> processNextStart() {
+ if (null != this.barrier) {
+ this.barrierIterator = this.barrier.entrySet().iterator();
+ this.barrier = null;
+ }
+ while (this.barrierIterator != null &&
this.barrierIterator.hasNext()) {
+ if (null == this.barrierIterator)
--- End diff --
`this.barrierIterator` can never be null within within the `while()` loop.
Unless I overlooked something fundamental, `processNextStart` can be simplified
to:
```
protected Traverser.Admin<S> processNextStart() {
if (null != this.barrier) {
this.barrierIterator = this.barrier.entrySet().iterator();
this.barrier = null;
while (this.barrierIterator.hasNext()) {
final Map.Entry<Object, Traverser.Admin<S>> entry =
this.barrierIterator.next();
if (this.duplicateSet.add(entry.getKey()))
return
PathProcessor.processTraverserPathLabels(entry.getValue(), this.keepLabels);
}
}
return
PathProcessor.processTraverserPathLabels(super.processNextStart(),
this.keepLabels);
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---