Bug 1497831 - Followup as point as out by froydnj, r=me
authorTom Schuster <evilpies@gmail.com>
Wed, 17 Oct 2018 18:21:55 +0200
changeset 441675 16ee6006e57cce243c85a5ab7578b43f3a084213
parent 441674 c06d1f31c0914b09091a7e2d531c782607504d0e
child 441676 a4a26e661fa517b4304e4a0d8e5f4d4e8bbba684
push id109026
push userevilpies@gmail.com
push dateWed, 17 Oct 2018 16:23:59 +0000
treeherdermozilla-inbound@16ee6006e57c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1497831
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497831 - Followup as point as out by froydnj, r=me
widget/cocoa/nsClipboard.mm
widget/cocoa/nsDragService.mm
--- a/widget/cocoa/nsClipboard.mm
+++ b/widget/cocoa/nsClipboard.mm
@@ -422,17 +422,17 @@ nsClipboard::HasDataMatchingFlavors(cons
     return NS_OK;
 
   // first see if we have data for this in our cached transferable
   if (mTransferable) {
     nsTArray<nsCString> flavors;
     nsresult rv = mTransferable->FlavorsTransferableCanImport(flavors);
     if (NS_SUCCEEDED(rv)) {
       for (uint32_t j = 0; j < flavors.Length(); j++) {
-        nsCString transferableFlavorStr = flavors[j];
+        const nsCString& transferableFlavorStr = flavors[j];
 
         for (uint32_t k = 0; k < aLength; k++) {
           if (transferableFlavorStr.Equals(aFlavorList[k])) {
             *outResult = true;
             return NS_OK;
           }
         }
       }
--- a/widget/cocoa/nsDragService.mm
+++ b/widget/cocoa/nsDragService.mm
@@ -577,17 +577,17 @@ nsDragService::IsDataFlavorSupported(con
         continue;
 
       nsTArray<nsCString> flavors;
       nsresult rv = currentTransferable->FlavorsTransferableCanImport(flavors);
       if (NS_FAILED(rv))
         continue;
 
       for (uint32_t j = 0; j < flavors.Length(); j++) {
-        if (dataFlavor.Equals(flavors[i])) {
+        if (dataFlavor.Equals(flavors[j])) {
           *_retval = true;
           return NS_OK;
         }
       }
     }
   }
 
   const NSString* type = nil;