Skip to content

Commit f8cece2

Browse files
committed
Avoid copying routes in routeIndex
1 parent 88456f7 commit f8cece2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

distribution/engine.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ func (e *Engine) routeIndex(key []byte) int {
122122
return -1
123123
}
124124
i--
125-
r := e.routes[i]
126-
if r.End != nil && bytes.Compare(key, r.End) >= 0 {
125+
if end := e.routes[i].End; end != nil && bytes.Compare(key, end) >= 0 {
127126
return -1
128127
}
129128
return i

0 commit comments

Comments
 (0)