Skip to content
Browse files

subscribers are per thread, so remove the nested hash access

  • Loading branch information...
1 parent 0b38152 commit b2ca26a44ca466ec5624be705b1e1ef5d5d7963c @tenderlove tenderlove committed Jun 19, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 activesupport/lib/active_support/notifications/fanout.rb
View
8 activesupport/lib/active_support/notifications/fanout.rb
@@ -88,9 +88,7 @@ def matches?(subscriber_or_name)
class Timed < Evented
def initialize(pattern, delegate)
- @timestack = Hash.new { |h,id|
- h[id] = Hash.new { |ids,name| ids[name] = [] }
- }
+ @timestack = []
super
end
@@ -99,11 +97,11 @@ def publish(name, *args)
end
def start(name, id, payload)
- @timestack[id][name].push Time.now
+ @timestack.push Time.now
end
def finish(name, id, payload)
- started = @timestack[id][name].pop
+ started = @timestack.pop
@delegate.call(name, started, Time.now, id, payload)
end
end

0 comments on commit b2ca26a

Please sign in to comment.
Something went wrong with that request. Please try again.