else mNeedToPrefetch = PR_FALSE;
nsresult nsMsgThreadEnumerator::Prefetch(){	nsresult rv=NS_OK;          // XXX or should this default to an error?	mResultHdr = nsnull;	if (mThreadParentKey == nsMsgKey_None)	{		rv = mThread->GetRootHdr(&mChildIndex, getter_AddRefs(mResultHdr));		mChildIndex = 0; // since root can be anywhere, set mChildIndex to 0.	}	else if (!mDone)	{		PRUint32 numChildren;		mThread->GetNumChildren(&numChildren);		while (mChildIndex < (PRInt32) numChildren)		{			rv  = mThread->GetChildHdrAt(mChildIndex++, getter_AddRefs(mResultHdr));			if (NS_SUCCEEDED(rv) && mResultHdr)			{				nsMsgKey parentKey;				nsMsgKey curKey;				mResultHdr->GetThreadParent(&parentKey);				mResultHdr->GetMessageKey(&curKey);				// if the parent is the same as the msg we're enumerating over,				// or the parentKey isn't set, and we're iterating over the top				// level message in the thread, then leave mResultHdr set to cur msg.				if (parentKey == mThreadParentKey || 						((parentKey == 0 || parentKey == nsMsgKey_None) 							&& mThreadParentKey == mFirstMsgKey && curKey != mThreadParentKey))					break;				mResultHdr = nsnull;			}		}	}	if (!mResultHdr) 	{        mDone = PR_TRUE;		return NS_ERROR_FAILURE;    }    if (NS_FAILED(rv)) 	{        mDone = PR_TRUE;        return rv;    }#ifdef DEBUG_bienvenu1	nsMsgKey debugMsgKey;	mResultHdr->GetMessageKey(&debugMsgKey);	printf("next for %ld = %ld\n", mThreadParentKey, debugMsgKey);#endif    return rv;}