Currently, there's no way to avoid having to do two lookups when using an nsClassHashtable if I want to look up an object that may have already been created that I then want to modify. This operation is easy to do using PLDHashTable (operate using PL_DHASH_ADD and use the resulting array). For nsClassHashtable, we could add this functionality pretty easily. Its users would have to have a default constructor, but IMO we could live with that. Is there a reason that we haven't done this before?
Created attachment 8459910 [details] [diff] [review] patch v1 I didn't add an infallible version of this, but one could be added pretty easily. Is there any reason not to do this?
Attachment #8459910 - Flags: review?(benjamin)
You might have better luck with a review from :froydnj, as I think bsmedberg is away for another week or so.
Comment on attachment 8459910 [details] [diff] [review] patch v1 The magic of templates means that this only has to compile if somebody uses it. This is fine. I wonder if we should do something similar for nsDataHashtable, but I guess we don't need to until somebody needs it there.
Attachment #8459910 - Flags: review?(benjamin) → review+
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.