You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2021/08/13 22:43:58 UTC

[commons-rng] branch master updated: Remove comment about a change to use a Supplier

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git


The following commit(s) were added to refs/heads/master by this push:
     new 6260581  Remove comment about a change to use a Supplier
6260581 is described below

commit 6260581afc9d41a2821d0b535ba8097eaa3c3177
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Fri Aug 13 23:42:18 2021 +0100

    Remove comment about a change to use a Supplier
    
    Use of the JDK 8 Supplier function has been implemented.
---
 .../distribution/EnumeratedDistributionSamplersPerformance.java         | 1 -
 .../examples/jmh/sampling/distribution/PoissonSamplersPerformance.java  | 2 --
 2 files changed, 3 deletions(-)

diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java
index c2a7033..bc55377 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/EnumeratedDistributionSamplersPerformance.java
@@ -169,7 +169,6 @@ public class EnumeratedDistributionSamplersPerformance {
          */
         private void createSamplerFactory(final UniformRandomProvider rng,
             final double[] probabilities) {
-            // This would benefit from Java 8 lambda functions
             if ("BinarySearchDiscreteSampler".equals(samplerType)) {
                 factory = () -> new BinarySearchDiscreteSampler(rng, probabilities);
             } else if ("AliasMethodDiscreteSampler".equals(samplerType)) {
diff --git a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java
index 54e704b..47880c6 100644
--- a/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java
+++ b/commons-rng-examples/examples-jmh/src/main/java/org/apache/commons/rng/examples/jmh/sampling/distribution/PoissonSamplersPerformance.java
@@ -163,8 +163,6 @@ public class PoissonSamplersPerformance {
         public void setup() {
             final RandomSource randomSource = RandomSource.valueOf(randomSourceName);
             generator = randomSource.create();
-
-            // This would benefit from Java 8 Supplier<DiscreteSampler> lambda function
             if ("SmallMeanPoissonSampler".equals(samplerType)) {
                 factory = () -> SmallMeanPoissonSampler.of(generator, mean);
             } else if ("KempSmallMeanPoissonSampler".equals(samplerType)) {