From f05f7ffb2e7e51d8f7e47df6356094aafba8437a Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 22 Oct 2013 10:39:56 -0700 Subject: do not search through the keys array twice --- railties/lib/rails/paths.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index bfac24d0c3..4a455e9196 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -124,8 +124,9 @@ module Rails end def children - keys = @root.keys.select { |k| k.include?(@current) } - keys.delete(@current) + keys = @root.keys.find_all { |k| + k.start_with?(@current) && k != @current + } @root.values_at(*keys.sort) end -- cgit v1.2.3