HBASE-9886 Optimize ServerName#compareTo
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1538679 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d6bdd54ecc
commit
e0a48e6d03
|
@ -255,8 +255,7 @@ public class ServerName implements Comparable<ServerName>, Serializable {
|
|||
|
||||
@Override
|
||||
public int compareTo(ServerName other) {
|
||||
int compare = this.getHostname().toLowerCase().
|
||||
compareTo(other.getHostname().toLowerCase());
|
||||
int compare = this.getHostname().compareToIgnoreCase(other.getHostname());
|
||||
if (compare != 0) return compare;
|
||||
compare = this.getPort() - other.getPort();
|
||||
if (compare != 0) return compare;
|
||||
|
|
Loading…
Reference in New Issue