Cole-Greer commented on code in PR #3157:
URL: https://github.com/apache/tinkerpop/pull/3157#discussion_r2260955137
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/P.java:
##########
@@ -37,10 +43,27 @@ public class P<V> implements Predicate<V>, Serializable,
Cloneable {
protected PBiPredicate<V, V> biPredicate;
protected V value;
protected V originalValue;
+ protected GValue<V> gValue;
+ protected GValue<V>[] gValues;
+
+ public P(final PBiPredicate<V, V> biPredicate, V value) {
+ if (value instanceof GValue) {
+ this.gValue = (GValue<V>) value;
+ this.value = ((GValue<V>) value).get();
+ } else if (value instanceof List && ((List) value).stream().anyMatch(v
-> v instanceof GValue)) {
Review Comment:
`P.within` and `P.without` do accept `Collection` so I agree this handling
needs to be broadened to account for that. I can certainly retain the original
collection type as well, however some properties such as element order may be
lost as GValues are replaced with scalars.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]