Skip to content

Commit a072d30

Browse files
author
bzbarsky%mit.edu
committed
nsCOMArray_base copy constructor should not assert. Bug 178534,
r=dougt, sr=alecf
1 parent 2af0dce commit a072d30

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

xpcom/ds/nsCOMArray.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,9 @@ PR_STATIC_CALLBACK(PRBool) ReleaseObjects(void* aElement, void*);
4747
// object gets another AddRef()
4848
nsCOMArray_base::nsCOMArray_base(const nsCOMArray_base& aOther)
4949
{
50-
PRInt32 count = aOther.Count();
5150
// make sure we do only one allocation
52-
mArray.SizeTo(count);
53-
54-
PRInt32 i;
55-
for (i=0; i<count; i++) {
56-
// ReplaceObjectAt will handle existing null entries for us
57-
ReplaceObjectAt(aOther[i], i);
58-
}
51+
mArray.SizeTo(aOther.Count());
52+
AppendObjects(aOther);
5953
}
6054

6155
PRBool

0 commit comments

Comments
 (0)