Skip to content

Commit 4fa2b2b

Browse files
committed
Cosmetics
1 parent c80d39b commit 4fa2b2b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/com/winterbe/java8/samples/concurrent/Atomic1.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import java.util.concurrent.ExecutorService;
44
import java.util.concurrent.Executors;
55
import java.util.concurrent.atomic.AtomicInteger;
6-
import java.util.function.IntBinaryOperator;
76
import java.util.stream.IntStream;
87

98
/**
@@ -45,10 +44,8 @@ private static void testAccumulate() {
4544

4645
IntStream.range(0, NUM_INCREMENTS)
4746
.forEach(i -> {
48-
Runnable task = () -> {
49-
IntBinaryOperator operator = (a, b) -> a + b;
50-
atomicInt.accumulateAndGet(i, operator);
51-
};
47+
Runnable task = () ->
48+
atomicInt.accumulateAndGet(i, (n, m) -> n + m);
5249
executor.submit(task);
5350
});
5451

0 commit comments

Comments
 (0)