Skip to content

Commit

Permalink
avoid ivars and extra array for response
Browse files Browse the repository at this point in the history
This adds is needless overhead and prevents thread-safety when
used with a thread-safe Aggregate-like object is passed via
:aggregate on initialize.
  • Loading branch information
Eric Wong committed Feb 26, 2011
1 parent cc8a893 commit 5dd8251
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/rack/aggregate/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def call(env)
end

start = Time.now
@status, @headers, @response = @app.call(env)
response = @app.call(env)
@aggregate << (Time.now - start) * 1000

[@status, @headers, @response]
response
end
end
end
Expand Down

0 comments on commit 5dd8251

Please sign in to comment.