From 35060540205166ea2466144c01e79abfc3f36806 Mon Sep 17 00:00:00 2001 From: hlts2 Date: Tue, 10 Sep 2024 15:25:44 +0900 Subject: [PATCH] fix: deleted unnecessary nil check Signed-off-by: hlts2 --- pkg/agent/core/ngt/service/ngt.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/agent/core/ngt/service/ngt.go b/pkg/agent/core/ngt/service/ngt.go index 4803f0db26..33c0bfa46e 100644 --- a/pkg/agent/core/ngt/service/ngt.go +++ b/pkg/agent/core/ngt/service/ngt.go @@ -928,7 +928,7 @@ func (n *ngt) Start(ctx context.Context) <-chan error { } return ctx.Err() case <-tick.C: - if n != nil && n.vq != nil && !n.IsFlushing() && n.vq.IVQLen() >= n.alen { + if n.vq != nil && !n.IsFlushing() && n.vq.IVQLen() >= n.alen { err = n.CreateIndex(ctx, n.poolSize) } case <-limit.C: @@ -1949,21 +1949,21 @@ func (n *ngt) gc() { } func (n *ngt) Len() uint64 { - if n != nil && n.kvs != nil && !n.IsFlushing() { + if n.kvs != nil && !n.IsFlushing() { return n.kvs.Len() } return 0 } func (n *ngt) InsertVQueueBufferLen() uint64 { - if n != nil && n.vq != nil && !n.IsFlushing() { + if n.vq != nil && !n.IsFlushing() { return uint64(n.vq.IVQLen()) } return 0 } func (n *ngt) DeleteVQueueBufferLen() uint64 { - if n != nil && n.vq != nil && !n.IsFlushing() { + if n.vq != nil && !n.IsFlushing() { return uint64(n.vq.DVQLen()) } return 0