Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
- We can access the pointer members directly
- Easier to read concatenation
  • Loading branch information
muesli authored and pkieltyka committed Aug 7, 2019
1 parent 5f33708 commit b83ac99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ type RouteParams struct {

// Add will append a URL parameter to the end of the route param
func (s *RouteParams) Add(key, value string) {
(*s).Keys = append((*s).Keys, key)
(*s).Values = append((*s).Values, value)
s.Keys = append(s.Keys, key)
s.Values = append(s.Values, value)
}

// ServerBaseContext wraps an http.Handler to set the request context to the
Expand Down
2 changes: 1 addition & 1 deletion tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ func patNextSegment(pattern string) (nodeTyp, string, string, byte, int, int) {
rexpat = "^" + rexpat
}
if rexpat[len(rexpat)-1] != '$' {
rexpat = rexpat + "$"
rexpat += "$"
}
}

Expand Down

0 comments on commit b83ac99

Please sign in to comment.