Closed
Bug 1693530
Opened 5 years ago
Closed 5 years ago
Add nsBaseHashtable::TryLookupOrInsertWith variant that accepts a functor returning a mozilla::Result
Categories
(Core :: XPCOM, task)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
88 Branch
| Tracking | Status | |
|---|---|---|
| firefox88 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
Details
Attachments
(1 external file)
It would be desirable if we were able to write something like:
MOZ_TRY_UNWRAP(val, hashtable.LookupOrInsertWith(key, []() -> Result<DataType, nsresult> {
auto res = MakeUnique<Foo>();
MOZ_TRY(res->DoSomething());
return res;
});
Otherwise, we need to resort to WithEntryHandle in such a case and get very deep nesting typically.
| Assignee | ||
Updated•5 years ago
|
Summary: Migrate nsBaseHashtable::LookupOrInsertWith that accepts a functor returning a mozilla::Result → Add nsBaseHashtable::LookupOrInsertWith variant that accepts a functor returning a mozilla::Result
| Assignee | ||
Comment 1•5 years ago
|
||
Depends on D105633
Updated•5 years ago
|
Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
| Assignee | ||
Updated•5 years ago
|
Summary: Add nsBaseHashtable::LookupOrInsertWith variant that accepts a functor returning a mozilla::Result → Add nsBaseHashtable::TryLookupOrInsertWith variant that accepts a functor returning a mozilla::Result
Updated•5 years ago
|
Attachment #9203968 -
Attachment description: Bug 1693530 - Add nsBaseHashtable::LookupOrInsertWith variant that accepts a functor returning a mozilla::Result. r=#xpcom-reviewers,janv → Bug 1693530 - Add nsBaseHashtable::TryLookupOrInsertWith variant that accepts a functor returning a mozilla::Result. r=#xpcom-reviewers,janv
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3e8813dd91c1
Add nsBaseHashtable::TryLookupOrInsertWith variant that accepts a functor returning a mozilla::Result. r=janv,xpcom-reviewers,nika
Comment 3•5 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox88:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•