Bug 841381 - Fix bustage caused by replacement of GreatestIndexLtEq in mozilla-central (bug 618479). r=Neil CLOSED TREE
authorMark Banner <bugzilla@standard8.plus.com>
Thu, 14 Feb 2013 20:54:21 +0000
changeset 14856 daea5c34853ab566333c650710915c27c865d08a
parent 14855 9a7f8ded61c8437c88ab6161bba4163cfb30ffb4
child 14857 a0b3fd5a41f38e1c3ace0ef15a7a4586ff309ab7
push id867
push userbugzilla@standard8.plus.com
push dateMon, 01 Apr 2013 20:44:27 +0000
treeherdercomm-beta@797726b8d244 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs841381, 618479
Bug 841381 - Fix bustage caused by replacement of GreatestIndexLtEq in mozilla-central (bug 618479). r=Neil CLOSED TREE
mailnews/imap/src/nsImapFlagAndUidState.cpp
--- a/mailnews/imap/src/nsImapFlagAndUidState.cpp
+++ b/mailnews/imap/src/nsImapFlagAndUidState.cpp
@@ -230,19 +230,18 @@ bool nsImapFlagAndUidState::IsLastMessag
 
 // find a message flag given a key with non-recursive binary search, since some folders
 // may have thousand of messages, once we find the key set its index, or the index of
 // where the key should be inserted
 
 imapMessageFlagsType nsImapFlagAndUidState::GetMessageFlagsFromUID(uint32_t uid, bool *foundIt, int32_t *ndx)
 {
   PR_CEnterMonitor(this);
-  *foundIt = fUids.GreatestIndexLtEq(uid,
-                                     nsDefaultComparator<uint32_t, uint32_t>(),
-                                    (uint32_t *) ndx);
+  *ndx = (int32_t) fUids.IndexOfFirstElementGt(uid) - 1;
+  *foundIt = *ndx >= 0 && fUids[*ndx] == uid;
   imapMessageFlagsType retFlags = (*foundIt) ? fFlags[*ndx] : kNoImapMsgFlag;
   PR_CExitMonitor(this);
   return retFlags;
 }
 
 NS_IMETHODIMP nsImapFlagAndUidState::AddUidCustomFlagPair(uint32_t uid, const char *customFlag)
 {
   MutexAutoLock mon(mLock);