nsresult nsMsgDBThreadEnumerator::PrefetchNext()
nsresult nsMsgDBEnumerator::PrefetchNext()
nsresult nsMsgDBThreadEnumerator::PrefetchNext(){	nsresult rv;	nsIMdbTable *table = nsnull;	if (!mTableCursor)	{		rv = GetTableCursor();		if (NS_FAILED(rv))			return rv;	}    while (PR_TRUE) 	{        NS_IF_RELEASE(mResultThread);        mResultThread = nsnull;        rv = mTableCursor->NextTable(mDB->GetEnv(), &table);		if (!table) 		{            mDone = PR_TRUE;			return NS_ERROR_FAILURE;        }        if (NS_FAILED(rv)) 		{            mDone = PR_TRUE;            return rv;        }        if (NS_FAILED(rv)) 			return rv;        mResultThread = new nsMsgThread(mDB, table);		if(mResultThread)		{			PRUint32 numChildren = 0;			NS_ADDREF(mResultThread);			mResultThread->GetNumChildren(&numChildren);			// we've got empty thread; don't tell caller about it.			if (numChildren == 0)				continue;		}		if (mFilter && mFilter(mResultThread) != NS_OK)			continue;		else			break;    }    if (mResultThread) 	{		mNextPrefetched = PR_TRUE;        return NS_OK;    }    return NS_ERROR_FAILURE;}