Skip to content
Myr

Refactored Router#matchingRoute()

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

authored by visionmedia · committed by visionmedia · parent 300cfe7 · Browse files · 1 file+6 added−11 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+6 added−11 removed

  • other:+6 added−11 removed

1 file+6 added−11 removed

modified:lib/express/core.js+6 added-11 removed
129 unmodified lines
130 * @api private131 */132 133 matchingRoute: function() {134 // Stop at the first match. If request.pass() was called135 // continue from where we left off 136 var i = -1137 this.matchingRoute = function() {138 var routes = Express.routes, route139 while (route = routes[++i]) 140 if (this.match(route))141 break142 return route134 this.lastMatchingRoute = this.lastMatchingRoute || 0135 var routes = Express.routes, route136 while (route = routes[this.lastMatchingRoute++]) 137 if (this.match(route))138 break139 return route143 }144 return this.matchingRoute() 140 },141 142 /**143 * Check if _route_ matches the current request.
203 unmodified lines