Bug 610611 - redundant GetMessageKey() call; r=bienvenu
authorBoying Lu <brian.lu@oracle.com>
Thu, 18 Nov 2010 13:37:55 +0000
changeset 6712 9a268939f29cbb223900a3d73b770e0b60e5143b
parent 6711 9bf1ef38cc60d4fcff5b634e3199877829e137ab
child 6713 703c6fba35bfbddd388c6c099458beed87c2901f
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs610611
Bug 610611 - redundant GetMessageKey() call; r=bienvenu
mailnews/db/msgdb/src/nsMsgThread.cpp
--- a/mailnews/db/msgdb/src/nsMsgThread.cpp
+++ b/mailnews/db/msgdb/src/nsMsgThread.cpp
@@ -199,24 +199,23 @@ NS_IMETHODIMP nsMsgThread::GetNumUnreadC
 {
   NS_ENSURE_ARG_POINTER(result);
   *result = m_numUnreadChildren;
   return NS_OK;
 }
 
 nsresult nsMsgThread::RerootThread(nsIMsgDBHdr *newParentOfOldRoot, nsIMsgDBHdr *oldRoot, nsIDBChangeAnnouncer *announcer)
 {
+  nsresult rv = NS_OK;
+  mdb_pos outPos;
+  nsMsgKey newHdrAncestor;
   nsCOMPtr <nsIMsgDBHdr> ancestorHdr = newParentOfOldRoot;
   nsMsgKey newRoot;
-  newParentOfOldRoot->GetMessageKey(&newRoot);
-  mdb_pos outPos;
 
-  nsMsgKey newHdrAncestor;
   ancestorHdr->GetMessageKey(&newRoot);
-  nsresult rv = NS_OK;
   // loop trying to find the oldest ancestor of this msg
   // that is a parent of the root. The oldest ancestor will
   // become the root of the thread.
   do
   {
     ancestorHdr->GetThreadParent(&newHdrAncestor);
     if (newHdrAncestor != nsMsgKey_None && newHdrAncestor != m_threadRootKey && newHdrAncestor != newRoot)
     {