Skip to content

Commit

Permalink
Tidy up MethodsFor
Browse files Browse the repository at this point in the history
  • Loading branch information
shirro committed Feb 9, 2014
1 parent 26855a7 commit 1e9553f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions router.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,8 @@ func hasMethod(methods []string, method string) bool {
func (r routes) MethodsFor(path string) []string {
methods := []string{}
for _, route := range r.router.routes {
if route.regex.MatchString(path) {
if !hasMethod(methods, route.method) {
methods = append(methods, route.method)
}
if route.regex.MatchString(path) && !hasMethod(methods, route.method) {
methods = append(methods, route.method)
}
}
return methods
Expand Down

0 comments on commit 1e9553f

Please sign in to comment.