Closed Bug 1481138 Opened 6 years ago Closed 6 years ago

Smooth some rough edges off the mozilla::HashTable API

Categories

(Core :: MFBT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

Attachments

(4 files)

      No description provided.
Comment on attachment 8997782 [details]
Bug 1481138 - Remove the add() variant in HashTable and GCHashTable that uses a default value.

https://reviewboard.mozilla.org/r/261516/#review268568

Hah, agreed.
Attachment #8997782 - Flags: review?(luke) → review+
Comment on attachment 8997783 [details]
Bug 1481138 - Remove HashMap::lookupWithDefault().

https://reviewboard.mozilla.org/r/261518/#review268570

Yeah, much more readable as two operations.
Attachment #8997783 - Flags: review?(luke) → review+
Comment on attachment 8997784 [details]
Bug 1481138 - Remove Hash{Map,Set}::putNewInfallible.

https://reviewboard.mozilla.org/r/261520/#review268576
Attachment #8997784 - Flags: review?(luke) → review+
Comment on attachment 8997785 [details]
Bug 1481138 - Clarify that Hash{Map,Set}::putNew() can be used if elements have been removed.

https://reviewboard.mozilla.org/r/261522/#review268578

Nice!
Attachment #8997785 - Flags: review?(luke) → review+
Ugh, the third patch causes test failures. It's because putNew() contains a checkSimulatedOOM() call while putNewInfallible() does not. So the jit-tests harness inserts some OOMs and those MOZ_ALWAYS_TRUE() assertions I inserted fail. Bleh.

I think I will abandon patch 3 and keep putNewInfallible(), but comment it better in patch 4.
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/49d5dcbe36ff
Remove the add() variant in HashTable and GCHashTable that uses a default value. r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/01dcd8f80341
Remove HashMap::lookupWithDefault(). r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/09cd991472c9
Clarify that Hash{Map,Set}::putNew() can be used if elements have been removed. r=luke
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: