You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2022/07/21 12:36:50 UTC

[rocketmq-client-go] branch master updated: feat(fmt): compare slice length directly (#851)

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

dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git


The following commit(s) were added to refs/heads/master by this push:
     new db78506  feat(fmt): compare slice length directly (#851)
db78506 is described below

commit db785069eb1cfc3c7ed7f704f327925ee136d688
Author: j2gg0s <j2...@gmail.com>
AuthorDate: Thu Jul 21 20:36:46 2022 +0800

    feat(fmt): compare slice length directly (#851)
---
 consumer/push_consumer.go | 2 +-
 producer/producer.go      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/consumer/push_consumer.go b/consumer/push_consumer.go
index eb29a48..9bf402b 100644
--- a/consumer/push_consumer.go
+++ b/consumer/push_consumer.go
@@ -774,7 +774,7 @@ func (pc *pushConsumer) pullMessage(request *PullRequest) {
 
 			msgFounded := result.GetMessageExts()
 			firstMsgOffset := int64(math.MaxInt64)
-			if msgFounded != nil && len(msgFounded) != 0 {
+			if len(msgFounded) != 0 {
 				firstMsgOffset = msgFounded[0].QueueOffset
 				pc.stat.increasePullTPS(pc.consumerGroup, request.mq.Topic, len(msgFounded))
 				pq.putMessage(msgFounded...)
diff --git a/producer/producer.go b/producer/producer.go
index a30764d..3ead53f 100644
--- a/producer/producer.go
+++ b/producer/producer.go
@@ -561,7 +561,7 @@ func (p *defaultProducer) IsPublishTopicNeedUpdate(topic string) bool {
 		return true
 	}
 	info := v.(*internal.TopicPublishInfo)
-	return info.MqList == nil || len(info.MqList) == 0
+	return len(info.MqList) == 0
 }
 
 func (p *defaultProducer) IsUnitMode() bool {