diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-04-23 06:56:50 -0700 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-04-23 06:56:50 -0700 |
commit | 1bd92ed6b00e7938cfe9a8e01275170c49e9893d (patch) | |
tree | fd7d756a61595421859eca447a657abd688bc4d8 | |
parent | a56b150b6401cc3384d2be2db7530662047966e0 (diff) | |
parent | 5e6a85df06f99c489c96939561e33bf6f5a5dd4f (diff) | |
download | rails-1bd92ed6b00e7938cfe9a8e01275170c49e9893d.tar.gz rails-1bd92ed6b00e7938cfe9a8e01275170c49e9893d.tar.bz2 rails-1bd92ed6b00e7938cfe9a8e01275170c49e9893d.zip |
Merge pull request #10318 from vipulnsward/refactor_obvious
refactor initialization of array
-rw-r--r-- | activesupport/lib/active_support/callbacks.rb | 5 |
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) |