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

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


The following commit(s) were added to refs/heads/native by this push:
     new 41f7106  fix(message): 错误的 equals实现 (#319)
41f7106 is described below

commit 41f7106974b58f7f14e7422a58336234e183382e
Author: xujianhai666 <[email protected]>
AuthorDate: Tue Dec 17 14:37:30 2019 +0800

    fix(message): 错误的 equals实现 (#319)
    
    - remove extra equal method
    
    Closes #317
---
 consumer/consumer.go | 2 +-
 primitive/message.go | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/consumer/consumer.go b/consumer/consumer.go
index 103fcf1..fcb14d2 100644
--- a/consumer/consumer.go
+++ b/consumer/consumer.go
@@ -472,7 +472,7 @@ func (dc *defaultConsumer) lock(mq *primitive.MessageQueue) 
bool {
                        pq.UpdateLastConsumeTime()
                        pq.UpdateLastLockTime()
                }
-               if _mq.Equals(mq) {
+               if _mq == *mq {
                        lockOK = true
                }
        }
diff --git a/primitive/message.go b/primitive/message.go
index 7461525..0608a61 100644
--- a/primitive/message.go
+++ b/primitive/message.go
@@ -360,11 +360,6 @@ func (mq *MessageQueue) HashCode() int {
        return result
 }
 
-func (mq MessageQueue) Equals(queue *MessageQueue) bool {
-       // TODO
-       return mq.BrokerName == queue.BrokerName && mq.Topic == queue.Topic && 
mq.QueueId == mq.QueueId
-}
-
 type AccessChannel int
 
 const (

Reply via email to