Skip to content

Commit

Permalink
Remove unnecessary logger from LazyStreams class
Browse files Browse the repository at this point in the history
Logger from LazyStreams class was removed due to its unused nature, de-cluttering the code. This commit is aimed at increasing code cleanliness and optimizing the class structure. Modifications in LazyStreams class are made for its clear and concise readability.
  • Loading branch information
kousen committed Nov 9, 2023
1 parent 57d4afd commit 35dd7ce
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/lazy/LazyStreams.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package lazy;

import java.util.logging.Logger;
import java.util.stream.IntStream;

public class LazyStreams {
private static final Logger logger = Logger.getLogger(LazyStreams.class.getName());

public static int multByTwo(int n) {
System.out.printf("Inside multByTwo with arg %d on thread %s%n",
n, Thread.currentThread().getName());
Expand All @@ -29,7 +26,7 @@ public static void main(String[] args) {

// Demonstrate laziness using print statements
firstEvenDoubleDivBy3 = IntStream.rangeClosed(100, 2_000_000)
// .parallel()
//.parallel()
.filter(LazyStreams::modByThree)
.map(LazyStreams::multByTwo)
.findFirst().orElse(0);
Expand Down

0 comments on commit 35dd7ce

Please sign in to comment.