Bug 1305422 - part 4 - don't call size_forward in nsIDNService.cpp; r=erahm
authorNathan Froyd <froydnj@mozilla.com>
Thu, 29 Sep 2016 22:33:58 -0400
changeset 315866 a5b04e48b3e8e70b8a213afb75170da85c4d5b62
parent 315865 e208dfe24c94f7c3cddbc27df9e49d7fadc2acaf
child 315867 1c06cb170aa873c9ee4e18f111a600752eba6c22
push id30757
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:02:43 +0000
treeherdermozilla-central@5ffed033557e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1305422
milestone52.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 1305422 - part 4 - don't call size_forward in nsIDNService.cpp; r=erahm We don't need to bother with iterators here at all; we can just ask the string for its data and length directly.
netwerk/dns/nsIDNService.cpp
--- a/netwerk/dns/nsIDNService.cpp
+++ b/netwerk/dns/nsIDNService.cpp
@@ -321,21 +321,18 @@ nsresult nsIDNService::ACEtoUTF8(const n
       _retval.Append(decodedBuf);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsIDNService::IsACE(const nsACString & input, bool *_retval)
 {
-  nsACString::const_iterator begin;
-  input.BeginReading(begin);
-
-  const char *data = begin.get();
-  uint32_t dataLen = begin.size_forward();
+  const char *data = input.BeginReading();
+  uint32_t dataLen = input.Length();
 
   // look for the ACE prefix in the input string.  it may occur
   // at the beginning of any segment in the domain name.  for
   // example: "www.xn--ENCODED.com"
 
   const char *p = PL_strncasestr(data, kACEPrefix, dataLen);
 
   *_retval = p && (p == data || *(p - 1) == '.');