aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2013-04-23 19:06:49 +0530
committerVipul A M <vipulnsward@gmail.com>2013-04-23 19:06:49 +0530
commit5e6a85df06f99c489c96939561e33bf6f5a5dd4f (patch)
treed8e80c96d3457c137abd93e923d567e3e9c624bc /activesupport/lib
parentee0d0eb07d259379d5b426e77afe01d168f353d4 (diff)
downloadrails-5e6a85df06f99c489c96939561e33bf6f5a5dd4f.tar.gz
rails-5e6a85df06f99c489c96939561e33bf6f5a5dd4f.tar.bz2
rails-5e6a85df06f99c489c96939561e33bf6f5a5dd4f.zip
refactor initialization of array
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/callbacks.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index 2f9247a77b..893c2500d7 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -340,10 +340,7 @@ module ActiveSupport
end
def compile
- method = []
- method << "value = nil"
- method << "halted = false"
-
+ method = ["value = nil", "halted = false"]
callbacks = "value = !halted && (!block_given? || yield)"
reverse_each do |callback|
callbacks = callback.apply(callbacks)