Bug 1454956 - change scheme loop to use a range-based for loop, r=nwgh
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 19 Apr 2018 16:13:00 +0100
changeset 468129 69008e17de668cca67e7a27c73245961fe285d23
parent 468128 ff1831623026f2f3b7e208c63810fee500b7e565
child 468130 c3da365d2916344fac340eeab98319089915e46f
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnwgh
bugs1454956
milestone61.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 1454956 - change scheme loop to use a range-based for loop, r=nwgh MozReview-Commit-ID: C0a6urRjBzn
netwerk/base/nsIOService.cpp
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -517,18 +517,18 @@ UsesExternalProtocolHandler(const char* 
         NS_LITERAL_CSTRING("chrome").Equals(aScheme) ||
         NS_LITERAL_CSTRING("resource").Equals(aScheme)) {
         // Don't allow file:, chrome: or resource: URIs to be handled with
         // nsExternalProtocolHandler, since internally we rely on being able to
         // use and read from these URIs.
         return false;
     }
 
-    for (unsigned int i = 0; i < NS_N(gForcedExternalSchemes); i++) {
-      if (!nsCRT::strcasecmp(gForcedExternalSchemes[i], aScheme)) {
+    for (const auto & forcedExternalScheme : gForcedExternalSchemes) {
+      if (!nsCRT::strcasecmp(forcedExternalScheme, aScheme)) {
         return true;
       }
     }
 
     nsAutoCString pref("network.protocol-handler.external.");
     pref += aScheme;
 
     return Preferences::GetBool(pref.get(), false);