Permalink
Browse files

refactor initialization of array

  • Loading branch information...
1 parent ee0d0eb commit 5e6a85df06f99c489c96939561e33bf6f5a5dd4f @vipulnsward vipulnsward committed Apr 23, 2013
Showing with 1 addition and 4 deletions.
  1. +1 −4 activesupport/lib/active_support/callbacks.rb
@@ -340,10 +340,7 @@ def initialize(name, config)
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)

0 comments on commit 5e6a85d

Please sign in to comment.