Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4fa2b2b

Browse files
committed
Cosmetics
1 parentc80d39b commit4fa2b2b

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
importjava.util.concurrent.ExecutorService;
44
importjava.util.concurrent.Executors;
55
importjava.util.concurrent.atomic.AtomicInteger;
6-
importjava.util.function.IntBinaryOperator;
76
importjava.util.stream.IntStream;
87

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

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp