This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

String hashCode


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 ]



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]