fix mark all read performance for news,r=sspitzer 17470

This commit is contained in:
bienvenu%netscape.com 2000-01-13 05:44:07 +00:00
Родитель d41822031d
Коммит ce4293d0ec
2 изменённых файлов: 1 добавлений и 23 удалений

Просмотреть файл

@ -1432,7 +1432,7 @@ NS_IMETHODIMP nsMsgDatabase::MarkAllRead(nsMsgKeyArray *thoseMarked)
}
if (numChanged > 0) // commit every once in a while
Commit(nsMsgDBCommitType::kSmallCommit);
Commit(nsMsgDBCommitType::kLargeCommit);
// force num new to 0.
PRInt32 numNewMessages;
@ -2849,17 +2849,6 @@ nsresult nsMsgDatabase::DumpThread(nsMsgKey threadId)
if (NS_FAILED(rv))
break;
#ifdef DEBUG_bienvenu
if (pMessage)
{
nsMsgKey key;
nsString subject;
(void)pMessage->GetMessageKey(&key);
pMessage->GetSubject(&subject);
printf("message in thread %u %s\n", key, (const char *) nsAutoCString(subject));
}
#endif /* DEBUG_bienvenu */
// NS_RELEASE(pMessage);
pMessage = nsnull;
}

Просмотреть файл

@ -218,17 +218,6 @@ NS_IMETHODIMP nsNewsDatabase::MarkHdrRead(nsIMsgDBHdr *msgHdr, PRBool bRead,
rv = nsMsgDatabase::MarkHdrRead(msgHdr, bRead, instigator);
if (NS_FAILED(rv)) return rv;
// sspitzer:
// yes, it is expensive to commit every time here.
//
// if we crash (the horror!) before we commit, the user will
// lose all there mark as read changes.
//
// since committing every time is expensive if we mark a
// whole bunch of headers as read, we should commit after we are
// done marking.
Commit(nsMsgDBCommitType::kSessionCommit);
return rv;
}