File tree Expand file tree Collapse file tree 1 file changed +2
-12
lines changed
Expand file tree Collapse file tree 1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,8 @@ NS_NewArrayEnumerator(nsISimpleEnumerator* *result,
8787 nsSimpleArrayEnumerator* enumer = new nsSimpleArrayEnumerator (array);
8888 if (enumer == nsnull)
8989 return NS_ERROR_OUT_OF_MEMORY;
90- NS_ADDREF (enumer);
9190 *result = enumer;
91+ NS_ADDREF (*result);
9292 return NS_OK;
9393}
9494
@@ -131,7 +131,7 @@ nsCOMArrayEnumerator::~nsCOMArrayEnumerator()
131131{
132132 // only release the entries that we haven't visited yet
133133 while (mIndex < mArraySize ) {
134- NS_RELEASE (mValueArray [mIndex ++]);
134+ NS_IF_RELEASE (mValueArray [mIndex ++]);
135135 }
136136}
137137
@@ -142,11 +142,6 @@ nsCOMArrayEnumerator::HasMoreElements(PRBool* aResult)
142142 if (! aResult)
143143 return NS_ERROR_NULL_POINTER;
144144
145- if (!mValueArray ) {
146- *aResult = PR_FALSE;
147- return NS_OK;
148- }
149-
150145 *aResult = (mIndex < mArraySize );
151146 return NS_OK;
152147}
@@ -158,11 +153,6 @@ nsCOMArrayEnumerator::GetNext(nsISupports** aResult)
158153 if (! aResult)
159154 return NS_ERROR_NULL_POINTER;
160155
161- if (!mValueArray ) {
162- *aResult = nsnull;
163- return NS_OK;
164- }
165-
166156 if (mIndex >= mArraySize )
167157 return NS_ERROR_UNEXPECTED;
168158
You can’t perform that action at this time.
0 commit comments