From 05337f61f93d4b28fea2cb269483aff0fa4f2545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 31 Mar 2010 16:00:10 +0200 Subject: yield always return an array, so we don't need to use .key? --- actionpack/lib/action_view/template/resolver.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'actionpack/lib/action_view/template/resolver.rb') 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 -- cgit v1.2.3