Closed Bug 1392881 Opened 7 years ago Closed 7 years ago

Merge StaticAtom and DynamicAtom

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

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

References

Details

Attachments

(1 file)

There's no reason for them to be separate, and we can use the |kind| field to distinguish the two kinds when necessary. This lets us remove the duplication of ScriptableToString(), ToUTF8String(), and ScriptableEquals(). It also lets us use |Atom*| pointers instead of |nsIAtom*| pointers in various places within nsAtomTable.cpp, which de-virtualizes various calls and removes the need for some static_casts.
Attachment #8900078 - Flags: review?(nfroyd)
Comment on attachment 8900078 [details] [diff] [review] Merge StaticAtom and DynamicAtom Review of attachment 8900078 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: xpcom/ds/nsAtomTable.cpp @@ +794,5 @@ > retVal = he->mAtom; > } else { > + RefPtr<Atom> atom = Atom::CreateDynamic(aUTF16String, hash); > + he->mAtom = atom; > + retVal = atom; Nit: retVal = atom.forget() to avoid unnecessary refcounting.
Attachment #8900078 - Flags: review?(nfroyd) → review+
Blocks: 1392883
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: