refactor(query): replace anonymous functions with sequence and for loop

This commit is contained in:
yusing
2025-06-03 20:51:00 +08:00
parent e737737415
commit 58db228e25
2 changed files with 12 additions and 21 deletions

View File

@@ -137,9 +137,11 @@ func (p *Provider) Start(parent task.Parent) gperr.Error {
return nil
}
func (p *Provider) RangeRoutes(do func(string, *route.Route)) {
func (p *Provider) IterRoutes(yield func(string, *route.Route) bool) {
for alias, r := range p.routes {
do(alias, r)
if !yield(alias, r) {
break
}
}
}