From f8731704fc34345aaece207772750e78b038b416 Mon Sep 17 00:00:00 2001 From: jmdyck Date: Sun, 10 Apr 2022 00:44:36 -0400 Subject: [PATCH 1/2] Rename "take" to "first" The sample code was changed 6 years ago, but not the accompanying prose. --- src/iterator.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iterator.cr b/src/iterator.cr index de58a339f8da..168332a6adac 100644 --- a/src/iterator.cr +++ b/src/iterator.cr @@ -11,7 +11,7 @@ require "./enumerable" # ``` # # The above works, but creates many intermediate arrays: one for the *select* call, -# one for the *map* call and one for the *take* call. A more efficient way is to invoke +# one for the *map* call and one for the *first* call. A more efficient way is to invoke # `Range#each` without a block, which gives us an `Iterator` so we can process the operations # lazily: # From 6ce368d5843a26fbc18b03dab68662e4a6990f9b Mon Sep 17 00:00:00 2001 From: jmdyck Date: Tue, 3 May 2022 14:55:30 -0400 Subject: [PATCH 2/2] src/iterator.cr: Also change some stars to backticks Co-authored-by: Sijawusz Pur Rahnama --- src/iterator.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iterator.cr b/src/iterator.cr index 168332a6adac..339cdb0351ed 100644 --- a/src/iterator.cr +++ b/src/iterator.cr @@ -10,8 +10,8 @@ require "./enumerable" # (1..10_000_000).select(&.even?).map { |x| x * 3 }.first(3) # => [6, 12, 18] # ``` # -# The above works, but creates many intermediate arrays: one for the *select* call, -# one for the *map* call and one for the *first* call. A more efficient way is to invoke +# The above works, but creates many intermediate arrays: one for the `select` call, +# one for the `map` call and one for the `first` call. A more efficient way is to invoke # `Range#each` without a block, which gives us an `Iterator` so we can process the operations # lazily: #