| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,6 @@ | |||
| 3 | 3 | import java.util.concurrent.ExecutorService; | |
| 4 | 4 | import java.util.concurrent.Executors; | |
| 5 | 5 | import java.util.concurrent.atomic.AtomicInteger; | |
| 6 | - import java.util.function.IntBinaryOperator; | ||
| 7 | 6 | import java.util.stream.IntStream; | |
| 8 | 7 | ||
| 9 | 8 | /** | |
@@ -45,10 +44,8 @@ private static void testAccumulate() { | |||
| 45 | 44 | ||
| 46 | 45 | IntStream.range(0, NUM_INCREMENTS) | |
| 47 | 46 | .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); | ||
| 52 | 49 | executor.submit(task); | |
| 53 | 50 | }); | |
| 54 | 51 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments