String hashCode

Bryce McKinlay bryce@albatross.co.nz
Wed Jan 31 15:20:00 GMT 2001


Is there a reason not to keep a hashcode field in String objects,
instead of recalculating it every time String.hashCode() is called?
This would speed up String.equals() by being able to return false
quickly in the common case, as well as speeding up things like
Hashtables of Strings and string interning.
regards
 [ bryce ]


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /