Closed Bug 66865 Opened 24 years ago Closed 24 years ago

Duplicate code in nsComponentManager

Categories

(Core :: XPCOM, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla0.8

People

(Reporter: bratell, Assigned: scc)

Details

There seems to be some extra code lines in nsComponentManager.cpp that costs 4 microseconds at startup (tripped over it while playing with Quantify). :-) The patch is below: diff -u -r1.141 nsComponentManager.cpp --- nsComponentManager.cpp 2001/01/27 22:50:24 1.141 +++ nsComponentManager.cpp 2001/01/28 14:51:36 @@ -816,7 +816,6 @@ nsCOMPtr<nsIRegistryEnumerator> regEnum = do_QueryInterface(cidEnum, &rv); if (NS_FAILED(rv)) return rv; - rv = regEnum->First(); for (rv = regEnum->First(); NS_SUCCEEDED(rv) && (regEnum->IsDone() != NS_OK); rv = regEnum->Next()) @@ -868,7 +867,6 @@ regEnum = do_QueryInterface(contractidEnum, &rv); if (NS_FAILED(rv)) return rv; - rv = regEnum->First(); for (rv = regEnum->First(); NS_SUCCEEDED(rv) && (regEnum->IsDone() != NS_OK); rv = regEnum->Next()) I can check it in if I get a review.
nsCOMPtr<nsIRegistryEnumerator> regEnum = do_QueryInterface(cidEnum, &rv); While you're in there you might want to turn that line into: nsCOMPtr<nsIRegistryEnumerator> regEnum(do_QueryInterface(cidEnum, &rv)); which avoids creating a temp. copy for some compilers. r=jag on the patch you have here though.
Has this patch been checked in? If not, I'll get it in as soon as possible.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.8
sr=scc?
I was waiting for the sr from jband, but if you take the sr, and want to check it in, it's fine with me.
sr=scc, yes. I'll check it in if no one else with access plans a checkin in the near future.
I'll check this in (if blake doesn't beat me to it)
Or Daniel for that matter :-) Sorry, missed your comment there. Wanna check this in?
Be my guest(s). That way I can go to sleep and won't have to wait for the tree to be green. :-) But, if haven't done it by the morning... :-)
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
(checked in the QI change..) Reopening, something happened to the resolution.
Status: RESOLVED → REOPENED
Fixed.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.