diff options
| author | jkubitz | 2021-03-01 08:10:56 +0000 |
|---|---|---|
| committer | Julian Honnen | 2021-03-18 07:18:02 +0000 |
| commit | a055c74e546351cc9356bde8e6c5eb95416f542e (patch) | |
| tree | ce1e005e986a668672f498d164db835a6c57f058 | |
| parent | ddfb146cefb296ab7b2b6c0cc32e6ccc114dc688 (diff) | |
| download | eclipse.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.java | 12 |
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); } /** |
