Skip to content

Commit

Permalink
address uncovered line
Browse files Browse the repository at this point in the history
  • Loading branch information
tb06904 committed Nov 24, 2023
1 parent ab31406 commit 56b7f69
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -110,16 +109,10 @@ public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
return Collections.emptyIterator();
}

if (propertyKeys.length == 1) {
final Property<U> property = properties.get(propertyKeys[0]);
return null == property ? Collections.emptyIterator() : IteratorUtils.of(property);
}

return (Iterator<Property<U>>) (Iterator) properties.entrySet()
.stream()
.filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys))
.map(entry -> entry.getValue())
.collect(Collectors.toList())
.iterator();
return properties.entrySet().stream()
.filter(entry -> ElementHelper.keyExists(entry.getKey(), propertyKeys))
.map(entry -> (Property<U>) entry.getValue())
.collect(Collectors.toList())
.iterator();
}
}

0 comments on commit 56b7f69

Please sign in to comment.