Skip to content
Permalink
Browse files
Remove comment about a change to use a Supplier
Use of the JDK 8 Supplier function has been implemented.
  • Loading branch information
aherbert committed Aug 13, 2021
1 parent da20fc8 commit 6260581afc9d41a2821d0b535ba8097eaa3c3177
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
@@ -169,7 +169,6 @@ public void setup() {
*/
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)) {
@@ -163,8 +163,6 @@ public DiscreteSampler getSampler() {
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)) {

0 comments on commit 6260581

Please sign in to comment.