From dev-return-63150-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Mon Jan 8 21:29:05 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 9257A180607 for ; Mon, 8 Jan 2018 21:29:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 824E2160C2C; Mon, 8 Jan 2018 20:29:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F1A1E160C29 for ; Mon, 8 Jan 2018 21:29:04 +0100 (CET) Received: (qmail 49903 invoked by uid 500); 8 Jan 2018 20:29:04 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 49892 invoked by uid 99); 8 Jan 2018 20:29:03 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2018 20:29:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id AC7FBDFC00; Mon, 8 Jan 2018 20:29:00 +0000 (UTC) From: franz1981 To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org References: In-Reply-To: Subject: [GitHub] activemq-artemis pull request #1757: ARTEMIS-1586 Reduce GC pressure due to ... Content-Type: text/plain Message-Id: <20180108202902.AC7FBDFC00@git1-us-west.apache.org> Date: Mon, 8 Jan 2018 20:29:00 +0000 (UTC) Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1757#discussion_r160247350 --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java --- @@ -259,22 +281,23 @@ public boolean equals(final Object other) { if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; - if (data.length != s.data.length) { - return false; - } - - for (int i = 0; i < data.length; i++) { - if (data[i] != s.data[i]) { - return false; - } - } - - return true; + return ByteUtil.equals(data, s.data); --- End diff -- I've implemented it in the last commit as: ``` @Override public boolean equals(final Object other) { if (this == other) { return true; } if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; if (s.hash != 0 && this.hash != 0) { if (s.hash != this.hash) return false; } if (s.str != null && this.str != null) { return this.str.equals(s.str); } else { return ByteUtil.equals(this.data, s.data); } } else { return false; } } ``` ---