Remove unneeded nil check before ranging over slice (#2900)

Ranging over a nil slice is just a noop as well.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz 2022-05-02 16:29:04 +02:00 committed by GitHub
parent 684484ef49
commit 710588f10f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 3 deletions

View File

@ -183,9 +183,6 @@ func (r *Route) Key() string {
// Walk traverses the route tree in depth-first order.
func (r *Route) Walk(visit func(*Route)) {
visit(r)
if r.Routes == nil {
return
}
for i := range r.Routes {
r.Routes[i].Walk(visit)
}