Make PLDHashTable::Search() const

RESOLVED FIXED in Firefox 63

Status

()

enhancement
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

Trunk
mozilla63
Points:
---

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(2 attachments)

PLDHashTable::Search() is now not marked as const.  Therefore, if its caller is marked as const, it needs to use const_cast.  So, let's mark the method (and related methods) as const.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 4

10 months ago
mozreview-review
Comment on attachment 8991871 [details]
Bug 1475461 - part 1: Mark PLDHashTable::Search() and called by it as const

https://reviewboard.mozilla.org/r/256794/#review263740

Wow, this ended up being a lot more invasive than I was hoping for...  Thanks very much for doing this!  :-)
Attachment #8991871 - Flags: review?(ehsan) → review+

Comment 5

10 months ago
mozreview-review
Comment on attachment 8991872 [details]
Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible

https://reviewboard.mozilla.org/r/256796/#review263742

Very nice!

::: dom/commandhandler/nsCommandParams.cpp:298
(Diff revision 1)
>  }
>  
>  nsCommandParams::HashEntry*
>  nsCommandParams::GetNamedEntry(const char* aName) const
>  {
> -  return static_cast<HashEntry*>(
> +  return static_cast<HashEntry*>(mValuesHash.Search((void*)aName));

Hmm, it'd be nice if the argument type were const void*...
Attachment #8991872 - Flags: review?(ehsan) → review+
Comment on attachment 8991872 [details]
Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible

https://reviewboard.mozilla.org/r/256796/#review263742

> Hmm, it'd be nice if the argument type were const void*...

Do you think that I should change it here? (You commented this as an open issue...)
(ping for replying to the review comment)
Flags: needinfo?(ehsan)
(In reply to Masayuki Nakano [:masayuki] (JST, +0900) from comment #6)
> Comment on attachment 8991872 [details]
> Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods
> if possible
> 
> https://reviewboard.mozilla.org/r/256796/#review263742
> 
> > Hmm, it'd be nice if the argument type were const void*...
> 
> Do you think that I should change it here? (You commented this as an open
> issue...)

Ah no, I was thinking out loud, I don't want to make you do more work here than you already did!  Thanks.  :-)

(Sorry, I keep forgetting that these comments open issues in MozReview, need to get better at noticing that...)
Flags: needinfo?(ehsan)
No, problem, thank you for your review!

Comment 10

10 months ago
Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/9f8a3c2f6528
part 1: Mark PLDHashTable::Search() and called by it as const r=Ehsan
https://hg.mozilla.org/integration/autoland/rev/de078de9ee98
part 2: Make callers of PLDHashTable::Search() const methods if possible r=Ehsan

Comment 11

10 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9f8a3c2f6528
https://hg.mozilla.org/mozilla-central/rev/de078de9ee98
Status: ASSIGNED → RESOLVED
Last Resolved: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.