Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkubitz2021-03-01 08:10:56 +0000
committerJulian Honnen2021-03-18 07:18:02 +0000
commita055c74e546351cc9356bde8e6c5eb95416f542e (patch)
treece1e005e986a668672f498d164db835a6c57f058
parentddfb146cefb296ab7b2b6c0cc32e6ccc114dc688 (diff)
downloadeclipse.jdt.core-a055c74e546351cc9356bde8e6c5eb95416f542e.tar.gz
eclipse.jdt.core-a055c74e546351cc9356bde8e6c5eb95416f542e.tar.xz
eclipse.jdt.core-a055c74e546351cc9356bde8e6c5eb95416f542e.zip
Bug 571579 - [performance] prefer Arrays.equals
Bug: 571579 Change-Id: I91ebbd5223c9024af72323589f880aed23aa34df Signed-off-by: jkubitz <jkubitz-eclipse@gmx.de>
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java
index 7c3ff68f06..17fb421565 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/core/compiler/CharOperation.java
@@ -2206,17 +2206,7 @@ public static final boolean equals(
* @return true if the two arrays are identical character by character, otherwise false
*/
public static final boolean equals(char[] first, char[] second) {
- if (first == second)
- return true;
- if (first == null || second == null)
- return false;
- if (first.length != second.length)
- return false;
-
- for (int i = first.length; --i >= 0;)
- if (first[i] != second[i])
- return false;
- return true;
+ return Arrays.equals(first, second);
}
/**

Back to the top