ghttp路由优先级改进

This commit is contained in:
John
2018-04-11 16:06:45 +08:00
parent 3bb3d27009
commit b0dc9064e0
22 changed files with 234 additions and 330 deletions

View File

@ -24,10 +24,12 @@ func NewStringInterfaceMap() *StringInterfaceMap {
}
// 给定回调函数对原始内容进行遍历
func (this *StringInterfaceMap) Iterator(f func (k string, v interface{})) {
func (this *StringInterfaceMap) Iterator(f func (k string, v interface{}) bool) {
this.mu.RLock()
for k, v := range this.m {
f(k, v)
if !f(k, v) {
break
}
}
this.mu.RUnlock()
}