small optimization

This commit is contained in:
chrislu 2022-12-27 04:08:13 -08:00
parent 86b9aa3173
commit 6d8bd1eedc

View file

@ -62,13 +62,13 @@ func readResolvedChunks(chunks []*filer_pb.FileChunk) (visibles []VisibleInterva
} }
} }
} else { } else {
var isLast bool isLast := true
for e := queue.Back(); e != nil; e = e.Prev() { for e := queue.Back(); e != nil; e = e.Prev() {
isLast = e.Next() == nil
if e.Value.(*Point).ts == point.ts { if e.Value.(*Point).ts == point.ts {
queue.Remove(e) queue.Remove(e)
break break
} }
isLast = false
} }
if isLast && lastPoint != nil { if isLast && lastPoint != nil {
visibles = addToVisibles(visibles, prevX, lastPoint, point) visibles = addToVisibles(visibles, prevX, lastPoint, point)