Bug 1612241 - Fix post-landing review comment. r=benc
authorGeoff Lankow <geoff@darktrojan.net>
Fri, 15 May 2020 12:39:00 +1200
changeset 39149 c2aeb710f2113c569ad196aae868330a00198b7b
parent 39148 c5efaf383dc1ae1fa32ea280dd7973a3a17bb7ce
child 39150 b49e6cda4e016e78743e2a50ec5293a60433484e
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersbenc
bugs1612241
Bug 1612241 - Fix post-landing review comment. r=benc
mailnews/addrbook/src/nsAbOutlookDirectory.cpp
--- a/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
@@ -264,24 +264,20 @@ NS_IMETHODIMP nsAbOutlookDirectory::Dele
   }
   nsresult retCode = NS_OK;
   nsAbWinHelperGuard mapiAddBook(mAbWinType);
 
   if (!mapiAddBook->IsOK()) {
     return NS_ERROR_FAILURE;
   }
 
-  uint32_t nbCards = aCards.Length();
-  uint32_t i = 0;
   nsAutoCString entryString;
   nsMapiEntry cardEntry;
 
-  for (i = 0; i < nbCards; ++i) {
-    RefPtr<nsIAbCard> card = aCards[i];
-
+  for (auto card : aCards) {
     retCode = ExtractCardEntry(card, entryString);
     if (NS_SUCCEEDED(retCode) && !entryString.IsEmpty()) {
       card->SetDirectoryId(EmptyCString());
 
       cardEntry.Assign(entryString);
       if (!mapiAddBook->DeleteEntry(*mMapiData, cardEntry)) {
         PRINTF(("Cannot delete card %s.\n", entryString.get()));
       } else {