Browse Source

Merge pull request #12 from temoto/patch-1

Removed excess bool variable assignment in `if`s
rodrigo moraes 13 years ago
parent
commit
51a7bc30e9
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mux.go

+ 2
- 2
mux.go View File

@ -51,7 +51,7 @@ type Router struct {
// Match matches registered routes against the request.
func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
for _, route := range r.routes {
if matched := route.Match(req, match); matched {
if route.Match(req, match) {
return true
}
}
@ -71,7 +71,7 @@ func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
}
var match RouteMatch
var handler http.Handler
if matched := r.Match(req, &match); matched {
if r.Match(req, &match) {
handler = match.Handler
setVars(req, match.Vars)
setCurrentRoute(req, match.Route)


Loading…
Cancel
Save