Skip to content

Commit 03786c1

Browse files
authored
Fix conclusion in Hamming approach (#3096)
* Fix conclusion in Hamming approach The information about one of the IntStream being more efficient just because it has less steps is incorrect because the extra steps does not result in additional iterations. In regards to the `for` loop, while the one shown does not show a `final` field, it does not mean that the code can be written in such a way that it is final. Fixes #3090 * Remove unused link Link no longer used since previous commit.
1 parent 443cc52 commit 03786c1

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

exercises/practice/hamming/.approaches/introduction.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ For more information, check the [`IntStream` with `reduce()` approach][approach-
127127
Since benchmarking with the [Java Microbenchmark Harness][jmh] is currently outside the scope of this document,
128128
the choice between the various approaches can be made by perceived readability.
129129

130-
Of the `IntStream` approaches, the `reduce()` approach likely might be fastest, as it is only one iteration
131-
instead of an iteration for `filter()` or `map()` and another iteration for `count()` or `sum()`.
132-
133-
The `for` loop may also be fast, but it leaves a mutable member variable for the distance, instead of one marked [`final`][final].
134-
135130
[for]: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html
136131
[intstream]: https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html
137132
[filter]: https://docs.oracle.com/javase/8/docs/api/java/util/stream/IntStream.html#filter-java.util.function.IntPredicate-
@@ -144,4 +139,3 @@ The `for` loop may also be fast, but it leaves a mutable member variable for the
144139
[approach-intstream-map-sum]: https://exercism.org/tracks/java/exercises/hamming/approaches/intstream-map-sum
145140
[approach-intstream-reduce]: https://exercism.org/tracks/java/exercises/hamming/approaches/intstream-reduce
146141
[jmh]: https://github.com/openjdk/jmh
147-
[final]: https://en.wikibooks.org/wiki/Java_Programming/Keywords/final

0 commit comments

Comments
 (0)