diff --git a/cmd/data-usage-cache.go b/cmd/data-usage-cache.go index 1ab28fe69..8d5e13f13 100644 --- a/cmd/data-usage-cache.go +++ b/cmd/data-usage-cache.go @@ -523,20 +523,18 @@ func (d *dataUsageCache) searchParent(h dataUsageHash) *dataUsageHash { want := h.Key() if idx := strings.LastIndexByte(want, '/'); idx >= 0 { if v := d.find(want[:idx]); v != nil { - for child := range v.Children { - if child == want { - found := hashPath(want[:idx]) - return &found - } + _, ok := v.Children[want] + if ok { + found := hashPath(want[:idx]) + return &found } } } for k, v := range d.Cache { - for child := range v.Children { - if child == want { - found := dataUsageHash(k) - return &found - } + _, ok := v.Children[want] + if ok { + found := dataUsageHash(k) + return &found } } return nil