Skip to content

Commit a0ac4de

Browse files
authored
Merge pull request Snailclimb#2803 from kimagery/kimagery-patch-1
Update java8-tutorial-translate.md
2 parents 4978a39 + 456f536 commit a0ac4de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/java/new-features/java8-tutorial-translate.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ for (int i = 0; i < max; i++) {
592592
```java
593593
//串行排序
594594
long t0 = System.nanoTime();
595-
long count = values.stream().sorted().count();
595+
long count = Arrays.stream(list.stream().sorted().toArray()).count();
596596
System.out.println(count);
597597

598598
long t1 = System.nanoTime();
@@ -612,7 +612,7 @@ sequential sort took: 709 ms//串行排序所用的时间
612612
//并行排序
613613
long t0 = System.nanoTime();
614614

615-
long count = values.parallelStream().sorted().count();
615+
long count = Arrays.stream(list.parallelStream().sorted().toArray()).count();
616616
System.out.println(count);
617617

618618
long t1 = System.nanoTime();

0 commit comments

Comments
 (0)