Closed Bug 933605 Opened 11 years ago Closed 11 years ago

Some pldhash clean-ups

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

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

Details

(Whiteboard: [qa-])

Attachments

(2 files)

I got me some pldhash clean-ups in hand, yes I do.
I too sometimes write ad hoc profiling code.  But I don't *land* it.
Attachment #825746 - Flags: review?(jorendorff)
Attachment #825746 - Flags: review?(jorendorff) → review+
Comment on attachment 825747 [details] [diff] [review]
(part 2) - Don't declare all vars at the top of functions in pldhash.cpp.

Review of attachment 825747 [details] [diff] [review]:
-----------------------------------------------------------------

All right.

::: xpcom/glue/pldhash.cpp
@@ +562,2 @@
>  
> +      case PL_DHASH_REMOVE: {

The curly braces aren't used here.

@@ +596,5 @@
>      ABORT_UNLESS(table->recursionLevel != IMMUTABLE_RECURSION_LEVEL);
>  
>      NS_ASSERTION(PL_DHASH_ENTRY_IS_LIVE(entry),
>                   "PL_DHASH_ENTRY_IS_LIVE(entry)");
> +    /* Load keyHash first in case clearEntry() goofs it. */

Style nit: blank line before comment (except at the top of a block).

@@ +728,2 @@
>      double sqsum, mean, variance, sigma;
> +    PLDHashEntryHdr *entry;

Heh. It's a little weird that you fixed all the others but not these!
Attachment #825747 - Flags: review?(jorendorff) → review+
> @@ +728,2 @@
> >      double sqsum, mean, variance, sigma;
> > +    PLDHashEntryHdr *entry;
> 
> Heh. It's a little weird that you fixed all the others but not these!

They're each used in two separate parts of the function, so the top was as good a place as any for them.
https://hg.mozilla.org/mozilla-central/rev/95af1e72abff
https://hg.mozilla.org/mozilla-central/rev/56fc3fc6a42a
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: