Bug 96108: Inline ElementAt(), add SafeElementAt(), voidarray usage fixes,

assertions for bad voidarray indexes.  r=jst, sr=waterson
This commit is contained in:
rjesup%wgate.com 2005-08-18 11:16:19 +00:00
parent 73ae417040
commit b20dd2c69a

View File

@ -354,13 +354,8 @@ NS_IMETHODIMP
nsSHEntry::GetChildAt(PRInt32 aIndex, nsISHEntry ** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
if (PRUint32(aIndex) >= PRUint32(mChildren.Count())) {
*aResult = nsnull;
}
else {
*aResult = (nsISHEntry*) mChildren.ElementAt(aIndex);
NS_IF_ADDREF(*aResult);
}
*aResult = (nsISHEntry*) mChildren.SafeElementAt(aIndex);
NS_IF_ADDREF(*aResult);
return NS_OK;
}