Closed Bug 344199 Opened 18 years ago Closed 18 years ago

nsDOMScriptObjectFactory::GetScriptRuntimeByID should fill in the array for fast lookup

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: alfred.peng, Assigned: alfred.peng)

Details

Attachments

(1 file, 1 obsolete file)

The language service should be filled into the array mLanguageArray for future fast lookup by ID.
Attached patch Patch v1 (obsolete) — Splinter Review
Attachment #228772 - Flags: review?(mhammond)
Comment on attachment 228772 [details] [diff] [review]
Patch v1

The 'if' block in the patch can go - we have already checked the array elt is NULL.  So that block can be reduced to simply:

mLanguageArray[NS_STID_INDEX(aLanguageID)] = lang;
Attached patch Patch v2Splinter Review
No ASSERTION needed here?
Assignee: general → alfred.peng
Attachment #228772 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #228914 - Flags: review?(mhammond)
Attachment #228772 - Flags: review?(mhammond)
Comment on attachment 228914 [details] [diff] [review]
Patch v2

That looks good to me.  No assertion is necessary, as the array element must be NULL.  Asking bz for sr, as I know he looked in this code at least once :)  Apologies in advance if that isn't appropriate.
Attachment #228914 - Flags: superreview?(bzbarsky)
Attachment #228914 - Flags: review?(mhammond)
Attachment #228914 - Flags: review+
Comment on attachment 228914 [details] [diff] [review]
Patch v2

Looks good!  sr=bzbarsky
Attachment #228914 - Flags: superreview?(bzbarsky) → superreview+
Checking in dom/src/base/nsDOMScriptObjectFactory.cpp;
/cvsroot/mozilla/dom/src/base/nsDOMScriptObjectFactory.cpp,v  <--  nsDOMScriptObjectFactory.cpp
new revision: 1.15; previous revision: 1.14
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: