ghttp路由优先级改进

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

View File

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