-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't add offense if .last is called with arguments in the same vein as .first change for 0.10.1
- Loading branch information
1 parent
e6e2f62
commit 6760318
Showing
2 changed files
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ def slow | |
def fast | ||
ARRAY.reverse.detect { |x| (x % 10).zero? } | ||
end | ||
|
||
ARRAY.select { |x| (x % 10).zero? }.last(5) |