You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by te...@apache.org on 2023/02/08 07:51:48 UTC

[pulsar] branch branch-2.11 updated: [improve][broker] Make Consumer#equals more effective (#18662)

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

technoboy pushed a commit to branch branch-2.11
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.11 by this push:
     new 31308c9944d [improve][broker] Make Consumer#equals more effective (#18662)
31308c9944d is described below

commit 31308c9944d19766f1dfe52534481932623c3b67
Author: 萧易客 <km...@live.com>
AuthorDate: Tue Nov 29 11:59:13 2022 +0800

    [improve][broker] Make Consumer#equals more effective (#18662)
---
 .../src/main/java/org/apache/pulsar/broker/service/Consumer.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java
index 8dfed3e36e3..5b0b37efdef 100644
--- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java
+++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Consumer.java
@@ -895,7 +895,7 @@ public class Consumer {
     public boolean equals(Object obj) {
         if (obj instanceof Consumer) {
             Consumer other = (Consumer) obj;
-            return Objects.equals(cnx.clientAddress(), other.cnx.clientAddress()) && consumerId == other.consumerId;
+            return consumerId == other.consumerId && Objects.equals(cnx.clientAddress(), other.cnx.clientAddress());
         }
         return false;
     }