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

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


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 25f7eabd229 [improve][broker] Improve Consumer.equals performance 
(#23864)
25f7eabd229 is described below

commit 25f7eabd229d22918ae4bda18e060eec20118e92
Author: Lari Hotari <[email protected]>
AuthorDate: Mon Jan 20 10:42:51 2025 -0800

    [improve][broker] Improve Consumer.equals performance (#23864)
    
    (cherry picked from commit 3c2ec2bf8bfd94eded46b42c5089dd8321afd096)
---
 .../src/main/java/org/apache/pulsar/broker/service/Consumer.java       | 3 +++
 1 file changed, 3 insertions(+)

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 ee5d6682217..9cf50165cd4 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
@@ -1004,6 +1004,9 @@ public class Consumer {
 
     @Override
     public boolean equals(Object obj) {
+        if (this == obj)  {
+            return true;
+        }
         if (obj instanceof Consumer) {
             Consumer other = (Consumer) obj;
             return consumerId == other.consumerId && 
Objects.equals(cnx.clientAddress(), other.cnx.clientAddress());

Reply via email to