Skip to content
Myr

No need to reverse plugins on each request

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This was slowing things down quite a bit

authored by visionmedia · committed by visionmedia · parent 7afa5c7 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:lib/express/request.js+2 added-2 removed
58 unmodified lines
59 this.params.post = this.params.post || {}60 this.plugins = Express.plugins.map(function(plugin){61 return new plugin.klass(plugin.options) 62 })63 this.reversedPlugins = this.plugins.slice(0).reverse()64 },65 66 /**67 * Set response header _key_ and _val_ or get
251 unmodified lines
319 reverse = callback,320 callback = data,321 data = null322 data = Object.merge({ request: this, response: this.response }, data)322 // TODO: no need to reverse plugins every time....323 var self = this,324 complete = 0,325 total = this.plugins.length,326 plugins = reverse327 ? self.plugins.reverse()327 ? self.reversedPlugins328 : self.plugins329 ;(function next(err) {330 if (err || complete === total)331 callback(err)
106 unmodified lines