Cole-Greer commented on code in PR #2919:
URL: https://github.com/apache/tinkerpop/pull/2919#discussion_r1862701741


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CoinStep.java:
##########
@@ -29,16 +30,23 @@
 import java.util.Set;
 
 /**
+ * A filter step that will randomly allow traversers to pass through the step 
based on a probability value.
+ *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public final class CoinStep<S> extends FilterStep<S> implements Seedable {
 
     private final Random random = new Random();
-    private final double probability;
+    private final GValue<Double> probability;
 
     public CoinStep(final Traversal.Admin traversal, final double probability) 
{
         super(traversal);
-        this.probability = probability;
+        this.probability = GValue.ofDouble(null, probability);

Review Comment:
   The one argument version of `GValue.ofDouble` (without name) is package 
private to discourage use of unnamed GValue's from users. There are a few 
places where unnamed GValues must be constructed to box literals into GValue's, 
however implicitly named variables created by unnamed GValue's will vary each 
time an identical traversal is constructed, which for many providers may limit 
the potential benefits from parameterization. For this reason unnamed GValues 
are discouraged for users.



-- 
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]

Reply via email to