Closed
Bug 271343
Opened 20 years ago
Closed 3 years ago
HashTable RemoveEntry should return boolean indicating whether it deleted sth or not
Categories
(Core :: XPCOM, defect, P3)
Tracking
()
RESOLVED
FIXED
People
(Reporter: vlad, Unassigned)
Details
Right now, RemoveEntry returns void, giving no indication whether the delete succeeded or not. Would be convenient to callers if it returned a boolean indicating what happened.
Comment 1•20 years ago
|
||
nsHashPropertyBag would benefit from this.
Updated•20 years ago
|
Assignee: dougt → vladimir
Updated•18 years ago
|
QA Contact: xpcom
Reporter | ||
Updated•17 years ago
|
Assignee: vladimir → nobody
Updated•11 years ago
|
Priority: -- → P3
Comment 2•3 years ago
|
||
Not sure if this has changed since the bug was filed, but PLDHashtable::RemoveEntry
and nsTHashtable::RemoveEntry
accept a pointer to an entry. This is obtained using PLDHashtable::Search
resp. nsTHashtable::GetEntry
. If there's no entry for a key, these functions return nullptr
, and it's not valid to pass nullptr
to RemoveEntry
, so RemoveEntry
always removes an entry.
OTOH, nsBaseHashtable::Remove
accepts a key and returns a bool as desired by the bug description.
Unless I misunderstand something here, I think this can be resolved.
Flags: needinfo?(vladimir)
Comment 3•3 years ago
|
||
Also, nsTHashtable::EnsureRemoved
has the property you ask for.
Comment 5•3 years ago
|
||
All's well that ends well ;)
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•