From d5fdc0d4480f3558de9d260be26d4c7782ebc781 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 9 May 2013 14:40:01 -0700 Subject: [PATCH] reduce the number of lambas --- activesupport/lib/active_support/callbacks.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb index 4ee8cf2457..027b5becf1 100644 --- a/activesupport/lib/active_support/callbacks.rb +++ b/activesupport/lib/active_support/callbacks.rb @@ -341,10 +341,7 @@ module ActiveSupport reverse_each do |callback| callbacks = callback.apply(callbacks) end - - lambda { |target, &block| - callbacks.call(target, false, nil, &block)[2] - } + callbacks end def append(*callbacks) @@ -384,7 +381,7 @@ module ActiveSupport str = object.send("_#{kind}_callbacks").compile class_eval do define_method(name) do |&block| - str.call self, &block + str.call(self, false, nil, &block)[2] end protected name end