From 6d8bd1eedc8e0b443b41e08ebc837fc6583e562a Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 27 Dec 2022 04:08:13 -0800 Subject: [PATCH] small optimization --- weed/filer/filechunks_read.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/filer/filechunks_read.go b/weed/filer/filechunks_read.go index e446615e2..3b5fad014 100644 --- a/weed/filer/filechunks_read.go +++ b/weed/filer/filechunks_read.go @@ -62,13 +62,13 @@ func readResolvedChunks(chunks []*filer_pb.FileChunk) (visibles []VisibleInterva } } } else { - var isLast bool + isLast := true for e := queue.Back(); e != nil; e = e.Prev() { - isLast = e.Next() == nil if e.Value.(*Point).ts == point.ts { queue.Remove(e) break } + isLast = false } if isLast && lastPoint != nil { visibles = addToVisibles(visibles, prevX, lastPoint, point)