diff options
author | José Valim <jose.valim@gmail.com> | 2010-03-31 16:00:10 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-03-31 16:02:59 +0200 |
commit | 05337f61f93d4b28fea2cb269483aff0fa4f2545 (patch) | |
tree | 1202a218c9cf056a89a45b85d4c9b20a00893bae /actionpack/lib | |
parent | 5562abb4e985dc6f57b0643fc655e93e495602da (diff) | |
download | rails-05337f61f93d4b28fea2cb269483aff0fa4f2545.tar.gz rails-05337f61f93d4b28fea2cb269483aff0fa4f2545.tar.bz2 rails-05337f61f93d4b28fea2cb269483aff0fa4f2545.zip |
yield always return an array, so we don't need to use .key?
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/template/resolver.rb | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 8e8afaa43f..a223b3a55f 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -35,12 +35,7 @@ module ActionView def cached(key, prefix, name, partial) return yield unless key && caching? - scope = @cached[key][prefix][name] - if scope.key?(partial) - scope[partial] - else - scope[partial] = yield - end + @cached[key][prefix][name][partial] ||= yield end end |