You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by lu...@apache.org on 2022/10/17 14:51:53 UTC

[skywalking-banyandb] 02/02: fix lint

This is an automated email from the ASF dual-hosted git repository.

lujiajing pushed a commit to branch fix-topn-post-processor
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git

commit 61fd5103e79352a6d8e69435fb14035e1928f1db
Author: Megrez Lu <lu...@gmail.com>
AuthorDate: Mon Oct 17 22:47:08 2022 +0800

    fix lint
---
 pkg/flow/dedup_priority_queue.go | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/pkg/flow/dedup_priority_queue.go b/pkg/flow/dedup_priority_queue.go
index 55fa120..a5c0f8e 100644
--- a/pkg/flow/dedup_priority_queue.go
+++ b/pkg/flow/dedup_priority_queue.go
@@ -21,7 +21,6 @@ import (
 	"container/heap"
 
 	"github.com/emirpasic/gods/utils"
-	"github.com/pkg/errors"
 )
 
 var _ heap.Interface = (*DedupPriorityQueue)(nil)
@@ -50,20 +49,6 @@ func NewPriorityQueue(comparator utils.Comparator, allowDuplicates bool) *DedupP
 	}
 }
 
-func (pq *DedupPriorityQueue) initCache() error {
-	if pq.allowDuplicates || len(pq.Items) == 0 {
-		return nil
-	}
-	for _, elem := range pq.Items {
-		if _, ok := pq.cache[elem]; !ok {
-			pq.cache[elem] = struct{}{}
-		} else {
-			return errors.New("duplicated item is not allowed")
-		}
-	}
-	return nil
-}
-
 // Len returns the DedupPriorityQueue length.
 func (pq *DedupPriorityQueue) Len() int { return len(pq.Items) }