Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Just remove the sort_locals method

  • Loading branch information...
commit 14a8fd146a64f7ed8399339fa5bc0200b54838ea 1 parent 1fbc470
Aaron Patterson tenderlove authored
Showing with 1 addition and 12 deletions.
  1. +1 −12 actionpack/lib/action_view/template/resolver.rb
13 actionpack/lib/action_view/template/resolver.rb
@@ -69,7 +69,7 @@ def build_path(name, prefix, partial)
# before returning it.
def cached(key, path_info, details, locals) #:nodoc:
name, prefix, partial = path_info
- locals = sort_locals(locals)
+ locals = { |x| x.to_s }.sort!
if key && caching?
@cached[key][name][prefix][partial][locals] ||= decorate(yield, path_info, details, locals)
@@ -98,17 +98,6 @@ def decorate(templates, path_info, details, locals) #:nodoc:
t.virtual_path ||= (cached ||= build_path(*path_info))
- if :symbol.respond_to?("<=>")
- def sort_locals(locals) #:nodoc:
- locals.sort
- end
- else
- def sort_locals(locals) #:nodoc:
- locals ={ |l| l.to_s }
- locals.sort!
- end
- end
# An abstract class that implements a Resolver with path semantics.

6 comments on commit 14a8fd1

Joost Baaij

Love it.

Matthias Lüdtke

Yeah, lovin it, too. But why this shouting?

Better perf for the inplace sort, right?

José Valim

It looks good assuming converting symbols to string unnecessary won't affect performance.

Matthias Lüdtke

BTW, is there any performance regression testing in place right now to catch these kind of things?

Aaron Patterson

@josevalim you have to do it in 1.9 anyway as the symbols aren't sortable.

Aaron Patterson

Oops, I mean 1.8. We can remove the convert to string in rails 4. :-)

Please sign in to comment.
Something went wrong with that request. Please try again.