Closed Bug 1436643 Opened 6 years ago Closed 6 years ago

Use a PLDHashTable `initEntry` function for Pref.

Categories

(Core :: Preferences: Backend, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

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

Details

Attachments

(1 file)

A small improvement.
Comment on attachment 8949276 [details]
Bug 1436643 - Use a PLDHashTable `initEntry` function for Pref.

https://reviewboard.mozilla.org/r/218644/#review224810

Thanks, proper initialization is always nice.

::: modules/libpref/Preferences.cpp:365
(Diff revision 1)
> +    auto pref = static_cast<Pref*>(aEntry);
> +    auto prefName = static_cast<const char*>(aKey);

We don't have anything in the style guide about this, but I find `auto*` slightly nicer for cases like this.  WDYT?  (I guess it's not local style, either...)
Attachment #8949276 - Flags: review?(nfroyd) → review+
> > +    auto prefName = static_cast<const char*>(aKey);
> 
> We don't have anything in the style guide about this, but I find `auto*`
> slightly nicer for cases like this.  WDYT? 

My opinion is that the type is present on the RHS, so there is no point duplicating any part of it on the LHS.
https://hg.mozilla.org/mozilla-central/rev/5cd9cebf800b
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: