Skip to content

Commit

Permalink
Fix:lock transfer to defer
Browse files Browse the repository at this point in the history
  • Loading branch information
hxmhlt committed Sep 12, 2019
1 parent 9eec723 commit 14ae6b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ func (c *URL) SetParam(key string, value string) {

func (c *URL) RangeParams(f func(key, value string) bool) {
c.paramsLock.RLock()
defer c.paramsLock.RUnlock()
for k, v := range c.params {
if !f(k, v[0]) {
break
}
}
c.paramsLock.RUnlock()
}

func (c URL) GetParam(s string, d string) string {
Expand Down

0 comments on commit 14ae6b7

Please sign in to comment.