-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perf: speed up 2 methods in railties.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
- Loading branch information
1 parent
dc2f26c
commit 8cfc601
Showing
2 changed files
with
2 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ def to_s | |
|
||
private | ||
def calculate_statistics | ||
@pairs.inject({}) { |stats, pair| stats[pair.first] = calculate_directory_statistics(pair.last); stats } | ||
Hash[@pais.map { |pair| [pair.first, calculate_directory_statistics(pair.last)] }] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
josevalim
Contributor
|
||
end | ||
|
||
def calculate_directory_statistics(directory, pattern = /.*\.rb$/) | ||
|
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
@pairs
has become@pais
(without the r). Typo?