5 ms·
Is this really a credible complaint? Someone who wrote this: public int hashCode() { return new Double(x).hashCode() ^ new Double(y).hashCode();
by jemfinch 14y ago
Is this really a credible complaint? Someone who wrote this:
public int hashCode() {
return new Double(x).hashCode() ^ new Double(y).hashCode();
}
does not seem to have the requisite understanding of how things to work to declare the inferiority of a widely used garbage collector.
- swah 14y agoCan you explain what is obviously wrong in this code?
- deleted 14y ago[deleted]
- jemfinch 14y agoYou don't need to allocate a new double to call hashCode on it. You can just call hashCode on the double you already have. Out of curiosity, what language background are you coming from that this isn't obvious?
- reeses 14y agoYou beat me to this issue. When I read this code I cringed, because it's so naïve it's like reading something intentionally pessimized, such as "if(new String("true").equals(new Boolean(b).toString()){...}" instead of "if(b){...}".