Skip to content

Commit

Permalink
Cleaned up...
Browse files Browse the repository at this point in the history
  • Loading branch information
janvitek committed Mar 24, 2013
1 parent 2d4a673 commit 9e09b20
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/water/H2ONode.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ static H2Okey read( AutoBuffer ab ) {
H2Okey key = ((H2ONode)x)._key;
if( key == this ) return 0;
// Note: long-math does not matter here, all we need is a reliable ordering.
//FIXME: Jan hack...
// int res = _ipv4 - key._ipv4;
// if( res != 0 ) return res;
// return udp_port() - key.udp_port();
int old = this.old_compare(key);
int hack = this.hack_compare(key);
assert Math.abs(old)== Math.abs(hack); // They don't have to agree ... but should not lie about equality
return hack;
}

private int hack_compare(H2Okey key) {
return name.compareTo(key.name);
}
private int old_compare(H2Okey key) {
int res = _ipv4 - key._ipv4;
if( res != 0 ) return res;
return udp_port() - key.udp_port();
}
}
public H2Okey _key;

Expand Down

0 comments on commit 9e09b20

Please sign in to comment.