aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/callbacks.rb
diff options
context:
space:
mode:
authorrxing <rick.xing@rcpaqap.com.au>2015-02-11 11:56:01 +1100
committerrxing <rick.xing@rcpaqap.com.au>2015-02-11 11:56:01 +1100
commitb82500e396b728f6dea42916fe3d491d7ba4224d (patch)
tree8c699e6c90e617ac543c4f3bd03896e1f7252d8b /activesupport/lib/active_support/callbacks.rb
parent2c5c0690cc5fc324a1b61126dc81ee10e4bf2b29 (diff)
downloadrails-b82500e396b728f6dea42916fe3d491d7ba4224d.tar.gz
rails-b82500e396b728f6dea42916fe3d491d7ba4224d.tar.bz2
rails-b82500e396b728f6dea42916fe3d491d7ba4224d.zip
remove unnecessary assignment and parameter passing in ActiveSupport::Callbacks::Filters::Around
Diffstat (limited to 'activesupport/lib/active_support/callbacks.rb')
-rw-r--r--activesupport/lib/active_support/callbacks.rb19
1 files changed, 7 insertions, 12 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 0d5035f637..51cf468d2b 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -291,13 +291,11 @@ module ActiveSupport
if !halted && user_conditions.all? { |c| c.call(target, value) }
user_callback.call(target, value) {
- env = run.call env
- env.value
+ run.call.value
}
-
env
else
- run.call env
+ run.call
end
end
end
@@ -309,11 +307,10 @@ module ActiveSupport
value = env.value
if env.halted
- run.call env
+ run.call
else
user_callback.call(target, value) {
- env = run.call env
- env.value
+ run.call.value
}
env
end
@@ -328,12 +325,11 @@ module ActiveSupport
if user_conditions.all? { |c| c.call(target, value) }
user_callback.call(target, value) {
- env = run.call env
- env.value
+ run.call.value
}
env
else
- run.call env
+ run.call
end
end
end
@@ -342,8 +338,7 @@ module ActiveSupport
def self.simple(callback_sequence, user_callback)
callback_sequence.around do |env, &run|
user_callback.call(env.target, env.value) {
- env = run.call env
- env.value
+ run.call.value
}
env
end