Closed Bug 1445079 Opened 6 years ago Closed 6 years ago

Remove nsHTMLTags::sTagAtomTable[]

Categories

(Core :: DOM: HTML Parser, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

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

References

Details

Attachments

(2 files)

nsHTMLTags::sTagAtomTable[] is completely unnecessary; we just end up with a pile of duplicate atom pointers.
Blocks: 1445113
Comment on attachment 8958267 [details]
Bug 1445079 - Rename nsHTMLTags::sTagUnicodeTable[] as sTagNames[].

https://reviewboard.mozilla.org/r/227196/#review233160
Attachment #8958267 - Flags: review?(nfroyd) → review+
Comment on attachment 8958268 [details]
Bug 1445079 - Remove nsHTMLTags::sTagAtomTable[].

https://reviewboard.mozilla.org/r/227198/#review233244

This seems like a win, even if the debug checking is a little more complicated.

::: parser/htmlparser/nsHTMLTags.cpp:48
(Diff revision 1)
> +#ifdef DEBUG
> +    uint32_t maxTagNameLength = 0;
> +#endif

Making this a `DebugOnly<uint32_t>` would enable getting rid of the preprocessor conditional here and at the `MOZ_ASSERT` outside of the loop.  You'd still want the conditional inside the loop, though, because you wouldn't want to do the string stuff...so not sure this change would be worth it.
Attachment #8958268 - Flags: review?(nfroyd) → review+
> Making this a `DebugOnly<uint32_t>` would enable getting rid of the
> preprocessor conditional here and at the `MOZ_ASSERT` outside of the loop. 
> You'd still want the conditional inside the loop, though, because you
> wouldn't want to do the string stuff...so not sure this change would be
> worth it.

I tried DebugOnly<> but it didn't play nicely with std::max(). 

I will move all the checking stuff into a second loop. The loop header will be repeated, but I think that's worth it to have a single DEBUG block for all the checking.
https://hg.mozilla.org/mozilla-central/rev/f82612511ab3
https://hg.mozilla.org/mozilla-central/rev/cffdea92ed42
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: