Bug 1200856 - Avoid the extra variable to make the string manipulation faster. r=sicking, a=2.1S+
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 02 Sep 2015 19:52:46 -0400
changeset 222385 9d414eb53b23
parent 222384 d058b8819614
child 222386 b2a5888625db
push id244
push userryanvm@gmail.com
push dateThu, 03 Sep 2015 20:34:59 +0000
treeherdermozilla-b2g34_v2_1s@b2a5888625db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking, 2
bugs1200856
milestone34.0
Bug 1200856 - Avoid the extra variable to make the string manipulation faster. r=sicking, a=2.1S+
content/base/src/nsCrossSiteListenerProxy.cpp
--- a/content/base/src/nsCrossSiteListenerProxy.cpp
+++ b/content/base/src/nsCrossSiteListenerProxy.cpp
@@ -371,29 +371,28 @@ nsPreflightCache::GetCacheKey(nsIURI* aU
   
   nsAutoCString scheme, host, port;
   if (uri) {
     uri->GetScheme(scheme);
     uri->GetHost(host);
     port.AppendInt(NS_GetRealPort(uri));
   }
 
-  nsAutoCString cred;
   if (aWithCredentials) {
     _retval.AssignLiteral("cred");
   }
   else {
     _retval.AssignLiteral("nocred");
   }
 
   nsAutoCString spec;
   rv = aURI->GetSpec(spec);
   NS_ENSURE_SUCCESS(rv, false);
 
-  _retval.Assign(cred + space + scheme + space + host + space + port + space +
+  _retval.Append(space + scheme + space + host + space + port + space +
                  spec);
 
   return true;
 }
 
 //////////////////////////////////////////////////////////////////////////
 // nsCORSListenerProxy