[haiku-development] BPrivate::HashSet GetHashCode() => HasValue()

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 20 Jan 2015 13:33:13 -0500

This is mostly directed at Ingo I think, I was playing with HashSets.

Yesterday I was trying to use a BPrivate::HashSet as found in headers/private/shared/HashSet.h with a BString as a key. However, when I added a BString to the HashSet it tries to call BString.GetHashCode() and complained that BString doesn't have that method.

BString does however have a HashValue() method, and I've noticed that other classes, like BInvoker, have a HashValue() method as well. I'm guessing that this method was added with the intent of making BStrings hashable in this way.

Would it be amenable to change the BPrivate::HashSet (and BPrivate::HashMap) to call HashValue() instead of GetHashCode() assuming they are suppose to do the same thing so that we can use unmodified BString keys?

Other related posts: