Skip to content

Commit

Permalink
fix: deleted unnecessary nil check
Browse files Browse the repository at this point in the history
Signed-off-by: hlts2 <[email protected]>
  • Loading branch information
hlts2 committed Sep 10, 2024
1 parent d4c79e2 commit 3506054
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/agent/core/ngt/service/ngt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Check warning on line 931 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L931

Added line #L931 was not covered by tests
err = n.CreateIndex(ctx, n.poolSize)
}
case <-limit.C:
Expand Down Expand Up @@ -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

Check warning on line 1955 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1955

Added line #L1955 was not covered by tests
}

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

Check warning on line 1962 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1962

Added line #L1962 was not covered by tests
}

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

Check warning on line 1969 in pkg/agent/core/ngt/service/ngt.go

View check run for this annotation

Codecov / codecov/patch

pkg/agent/core/ngt/service/ngt.go#L1969

Added line #L1969 was not covered by tests
Expand Down

0 comments on commit 3506054

Please sign in to comment.