Closed Bug 1646772 Opened 5 years ago Closed 5 years ago

Add a variant of nsClassHashtable::LookupOrAdd that accepts a factory function

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: sg, Assigned: sg)

References

Details

Attachments

(1 file)

nsClassHashtable::LookupOrAdd cannot be used when the arguments are not trivial, because they would be evaluated even if no element is added. A variant that uses a function argument that produces the new value and which is called only when a new element must be added would be handy.

Pushed by sgiesecke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/39272eb97a4c Add nsClassHashtable::LookupOrAddFromFactory and missing tests for nsClassHashtable::LookupForAdd. r=froydnj
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: