Bug 1402750 - Use Assign('') and Append('') for single character literals. r=aceman a=IanN DONTBUILD SEAMONKEY_2_49_ESR_RELBRANCH
authorJorg K <jorgk@jorgk.com>
Tue, 26 Sep 2017 00:43:57 +0200
branchSEAMONKEY_2_49_ESR_RELBRANCH
changeset 28319 3d893021229caef57831f03b40960a4b3bc2736d
parent 28318 9f8d76a9368bf80d151971e7756fe72e58b3e432
child 28320 cb7e2c0d38be0d7b2dfb3136d2de433d9879fa15
push id2136
push userfrgrahl@gmx.net
push dateMon, 15 Jul 2019 16:13:42 +0000
treeherdercomm-esr52@6b30146aa411 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, IanN
bugs1402750
Bug 1402750 - Use Assign('') and Append('') for single character literals. r=aceman a=IanN DONTBUILD SeaMonkey ESR52 release branch only.
mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
mailnews/addrbook/src/nsAbLDAPCard.cpp
mailnews/addrbook/src/nsAbLDAPDirectory.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
mailnews/addrbook/src/nsAbManager.cpp
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/search/src/nsMsgSearchValue.cpp
mailnews/base/src/nsMsgAccount.cpp
mailnews/base/src/nsMsgAccountManagerDS.cpp
mailnews/base/src/nsMsgGroupView.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgIdentity.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/compose/src/nsMsgAttachmentHandler.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/compose/src/nsSmtpServer.cpp
mailnews/imap/src/nsIMAPNamespace.cpp
mailnews/imap/src/nsImapFlagAndUidState.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/import/outlook/src/MapiApi.cpp
mailnews/import/outlook/src/nsOutlookMail.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsPop3Protocol.cpp
mailnews/mapi/mapihook/src/msgMapiHook.cpp
mailnews/mime/src/mimetpfl.cpp
--- a/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
+++ b/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
@@ -68,37 +68,37 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
             rv = childCondition->GetName (getter_Copies (name));
             NS_ENSURE_SUCCESS(rv, rv);
 
             if(name.Equals("card:nsIAbCard"))
                 return NS_OK;
         }
     }
 
-    filter.AppendLiteral("(");
+    filter.Append('(');
     switch (operation)
     {
         case nsIAbBooleanOperationTypes::AND:
-            filter.AppendLiteral("&");
+            filter.Append('&');
             rv = FilterExpressions (map, childExpressions, filter, flags);
             break;
         case nsIAbBooleanOperationTypes::OR:
-            filter.AppendLiteral("|");
+            filter.Append('|');
             rv = FilterExpressions (map, childExpressions, filter, flags);
             break;
         case nsIAbBooleanOperationTypes::NOT:
             if (count > 1)
                 return NS_ERROR_FAILURE;
-            filter.AppendLiteral("!");
+            filter.Append('!');
             rv = FilterExpressions (map, childExpressions, filter, flags);
             break;
         default:
             break;
     }
-    filter.AppendLiteral(")");
+    filter.Append(')');
 
     return rv;
 }
 
 nsresult nsAbBoolExprToLDAPFilter::FilterExpressions (
     nsIAbLDAPAttributeMap *map,
     nsIArray* expressions,
     nsCString& filter,
@@ -158,87 +158,87 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
     nsString value;
     rv = condition->GetValue (getter_Copies (value));
     NS_ENSURE_SUCCESS(rv, rv);
     NS_ConvertUTF16toUTF8 vUTF8 (value);
 
     switch (conditionType)
     {
         case nsIAbBooleanConditionTypes::DoesNotExist:
-            filter.AppendLiteral("(!("); 
+            filter.AppendLiteral("(!(");
             filter.Append(ldapAttr);
             filter.AppendLiteral("=*))");
             break;
         case nsIAbBooleanConditionTypes::Exists:
-            filter.AppendLiteral("("); 
+            filter.Append('(');
             filter.Append(ldapAttr);
             filter.AppendLiteral("=*)");
             break;
         case nsIAbBooleanConditionTypes::Contains:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
             filter.Append("=*");
             filter.Append(vUTF8);
             filter.AppendLiteral("*)");
             break;
         case nsIAbBooleanConditionTypes::DoesNotContain:
             filter.AppendLiteral("(!(");
             filter.Append(ldapAttr);
             filter.AppendLiteral("=*");
             filter.Append(vUTF8);
             filter.AppendLiteral("*))");
             break;
         case nsIAbBooleanConditionTypes::Is:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
-            filter.AppendLiteral("=");
+            filter.Append('=');
             filter.Append(vUTF8);
-            filter.AppendLiteral(")");
+            filter.Append(')');
             break;
         case nsIAbBooleanConditionTypes::IsNot:
             filter.AppendLiteral("(!(");
             filter.Append(ldapAttr);
-            filter.AppendLiteral("=");
+            filter.Append('=');
             filter.Append(vUTF8);
             filter.AppendLiteral("))");
             break;
         case nsIAbBooleanConditionTypes::BeginsWith:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
-            filter.AppendLiteral("=");
+            filter.Append('=');
             filter.Append(vUTF8);
             filter.AppendLiteral("*)");
             break;
         case nsIAbBooleanConditionTypes::EndsWith:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
             filter.AppendLiteral("=*");
             filter.Append(vUTF8);
-            filter.AppendLiteral(")");
+            filter.Append(')');
             break;
         case nsIAbBooleanConditionTypes::LessThan:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
             filter.AppendLiteral("<=");
             filter.Append(vUTF8);
-            filter.AppendLiteral(")");
+            filter.Append(')');
             break;
         case nsIAbBooleanConditionTypes::GreaterThan:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
             filter.AppendLiteral(">=");
             filter.Append(vUTF8);
-            filter.AppendLiteral(")");
+            filter.Append(')');
             break;
         case nsIAbBooleanConditionTypes::SoundsLike:
-            filter.AppendLiteral("(");
+            filter.Append('(');
             filter.Append(ldapAttr);
             filter.AppendLiteral("~=");
             filter.Append(vUTF8);
-            filter.AppendLiteral(")");
+            filter.Append(')');
             break;
         case nsIAbBooleanConditionTypes::RegExp:
             break;
         default:
             break;
     }
 
     return rv;
--- a/mailnews/addrbook/src/nsAbLDAPCard.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPCard.cpp
@@ -222,20 +222,20 @@ NS_IMETHODIMP nsAbLDAPCard::BuildRdn(nsI
     // so as to let the user know what is missing.
     if (NS_FAILED(rv) || propvalue.IsEmpty())
     {
       NS_ERROR("nsAbLDAPCard::BuildRdn: a required attribute is not set");
       return NS_ERROR_NOT_INITIALIZED;
     }
   
     aRdn.Append(attr);
-    aRdn.AppendLiteral("=");
+    aRdn.Append('=');
     aRdn.Append(propvalue);
     if (i < aAttrCount - 1)
-      aRdn.AppendLiteral("+");
+      aRdn.Append('+');
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbLDAPCard::GetDn(nsACString &aDN)
 {
   return GetPropertyAsAUTF8String(kDNColumn, aDN);
 }
--- a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
@@ -124,17 +124,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::GetChil
       if (fileName.IsEmpty())
         return NS_OK;
 
       // perform the same query, but on the local directory
       nsAutoCString localDirectoryURI(NS_LITERAL_CSTRING(kMDBDirectoryRoot));
       localDirectoryURI.Append(fileName);
       if (mIsQueryURI) 
       {
-        localDirectoryURI.AppendLiteral("?");
+        localDirectoryURI.Append('?');
         localDirectoryURI.Append(mQueryString);
       }
 
       nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID,
                                                      &rv));
       NS_ENSURE_SUCCESS(rv, rv);
 
       nsCOMPtr <nsIAbDirectory> directory;
@@ -755,17 +755,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::AddCard
   rv = currentUrl->GetDn(baseDN);
   NS_ENSURE_SUCCESS(rv, rv);
  
   // Calculate DN
   nsAutoCString cardDN;
   rv = card->BuildRdn(attrMap, rdnAttrs.GetSize(), rdnAttrs.GetArray(),
     cardDN);
   NS_ENSURE_SUCCESS(rv, rv);
-  cardDN.AppendLiteral(",");
+  cardDN.Append(',');
   cardDN.Append(baseDN);
 
   rv = card->SetDn(cardDN);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString ourUuid;
   GetUuid(ourUuid);
   copyToCard->SetDirectoryId(ourUuid);
@@ -875,17 +875,17 @@ NS_IMETHODIMP nsAbLDAPDirectory::ModifyC
     // Launch query
     rv = DoModify(this, nsILDAPModification::MOD_REPLACE, oldDN, modArray,
                   EmptyCString(), EmptyCString());
   }
   else
   {
     // Build and store the new DN
     nsAutoCString newDN(newRDN);
-    newDN.AppendLiteral(",");
+    newDN.Append(',');
     newDN.Append(baseDN);
     
     rv = card->SetDn(newDN);
     NS_ENSURE_SUCCESS(rv, rv);
     
     // Launch query
     rv = DoModify(this, nsILDAPModification::MOD_REPLACE, oldDN, modArray,
                   newRDN, baseDN);
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryModify.cpp
@@ -271,17 +271,17 @@ nsresult nsAbModifyLDAPMessageListener::
     printf("LDAP rename failed (code: %i, message: %s)\n",
            errCode, errMessage.get());
     return NS_ERROR_FAILURE;
   }
   
   // Rename succeeded, now update the card DN and
   // process the main task
   mCardDN.Assign(mNewRDN);
-  mCardDN.AppendLiteral(",");
+  mCardDN.Append(',');
   mCardDN.Append(mNewBaseDN);
      
   printf("LDAP rename succeeded\n");
   return DoTask();
 }
  
 nsAbLDAPDirectoryModify::nsAbLDAPDirectoryModify()
 {
--- a/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp
@@ -466,23 +466,23 @@ NS_IMETHODIMP nsAbLDAPDirectoryQuery::Do
   nsAutoCString searchFilter;
   if (urlFilter.Length() && !urlFilter.EqualsLiteral("(objectclass=*)"))
   {
     // if urlFilter isn't parenthesized, we need to add in parens so that
     // the filter works as a term to &
     //
     if (urlFilter[0] != '(')
     {
-      searchFilter = NS_LITERAL_CSTRING("(&(");
+      searchFilter.AssignLiteral("(&(");
       searchFilter.Append(urlFilter);
-      searchFilter.AppendLiteral(")");
+      searchFilter.Append(')');
     }
     else
     {
-      searchFilter = NS_LITERAL_CSTRING("(&");
+      searchFilter.AssignLiteral("(&");
       searchFilter.Append(urlFilter);
     }
   
     searchFilter += filter;
     searchFilter += ')';
   } 
   else
     searchFilter = filter;
--- a/mailnews/addrbook/src/nsAbManager.cpp
+++ b/mailnews/addrbook/src/nsAbManager.cpp
@@ -1154,30 +1154,30 @@ nsresult nsAbManager::AppendDNForCard(co
   nsString cnStr;
 
   rv = aAttrMap->GetFirstAttribute(NS_LITERAL_CSTRING(kDisplayNameProperty),
                                    ldapAttributeName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!displayName.IsEmpty()) {
     cnStr += NS_ConvertUTF8toUTF16(ldapAttributeName).get();
-    cnStr.AppendLiteral("=");
+    cnStr.Append('=');
     cnStr.Append(displayName);
     if (!email.IsEmpty()) {
-      cnStr.AppendLiteral(",");
+      cnStr.Append(',');
     }
   }
 
   rv = aAttrMap->GetFirstAttribute(NS_LITERAL_CSTRING(kPriEmailProperty),
                                    ldapAttributeName);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!email.IsEmpty()) {
     cnStr += NS_ConvertUTF8toUTF16(ldapAttributeName).get();
-    cnStr.AppendLiteral("=");
+    cnStr.Append('=');
     cnStr.Append(email);
   }
 
   rv = AppendProperty(aProperty, cnStr.get(), aResult);
   NS_ENSURE_SUCCESS(rv,rv);
   return rv;
 }
 
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -844,17 +844,17 @@ nsresult nsMsgSearchTerm::MatchArbitrary
       {
         *end = '\0';  // eat up the white space
         end--;      // move back and examine the previous character....
       }
 
       // any continuation whitespace is converted to a single space. This includes both a continuation line, or a
       //  second value of the same header (eg the received header)
       if (!headerFullValue.IsEmpty())
-        headerFullValue.AppendLiteral(" ");
+        headerFullValue.Append(' ');
       headerFullValue.Append(nsDependentCString(headerValue));
     }
   }
   delete bodyHandler;
   *pResult = result;
   return rv;
 }
 
--- a/mailnews/base/search/src/nsMsgSearchValue.cpp
+++ b/mailnews/base/search/src/nsMsgSearchValue.cpp
@@ -106,12 +106,12 @@ nsMsgSearchValueImpl::ToString(nsAString
         aResult.AppendLiteral("type=");
         aResult.Append(tempInt);
     }
         break;
     default:
         NS_ERROR("Unknown search value type");
     }        
 
-    aResult.AppendLiteral("]");
+    aResult.Append(']');
 
     return NS_OK;
 }
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -416,17 +416,17 @@ nsMsgAccount::SetKey(const nsACString& a
 }
 
 NS_IMETHODIMP
 nsMsgAccount::ToString(nsAString& aResult)
 {
   nsAutoString val;
   aResult.AssignLiteral("[nsIMsgAccount: ");
   aResult.Append(NS_ConvertASCIItoUTF16(m_accountKey));
-  aResult.AppendLiteral("]");
+  aResult.Append(']');
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccount::ClearAllValues()
 {
   nsresult rv = getPrefService();
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/src/nsMsgAccountManagerDS.cpp
+++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp
@@ -437,27 +437,27 @@ nsMsgAccountManagerDataSource::GetTarget
       // (or the folder pane)
       //
       // otherwise, return NS_RDF_NO_VALUE
       // so that the folder data source will take care of it.
       if (sourceValue && (strncmp(sourceValue, NC_RDF_PAGETITLE_PREFIX, strlen(NC_RDF_PAGETITLE_PREFIX)) == 0)) {
         if (source == kNC_PageTitleSMTP)
           str.AssignLiteral("900000000");
         else if (source == kNC_PageTitleServer)
-          str.AssignLiteral("1");
+          str.Assign('1');
         else if (source == kNC_PageTitleCopies)
-          str.AssignLiteral("2");
+          str.Assign('2');
         else if (source == kNC_PageTitleAddressing)
-          str.AssignLiteral("3");
+          str.Assign('3');
         else if (source == kNC_PageTitleSynchronization)
-          str.AssignLiteral("4");
+          str.Assign('4');
         else if (source == kNC_PageTitleDiskSpace)
-          str.AssignLiteral("4");
+          str.Assign('4');
         else if (source == kNC_PageTitleJunk)
-          str.AssignLiteral("5");
+          str.Assign('5');
         else {
           // allow for the accountmanager to be dynamically extended
           // all the other pages come after the standard ones
           // server, copies, addressing, disk space (or offline & disk space)
           CopyASCIItoUTF16(nsDependentCString(sourceValue), str);
         }
       }
       else {
--- a/mailnews/base/src/nsMsgGroupView.cpp
+++ b/mailnews/base/src/nsMsgGroupView.cpp
@@ -902,17 +902,17 @@ NS_IMETHODIMP nsMsgGroupView::CellTextFo
             else
             {
               uint32_t intKey;
               rv = colHandler->GetSortLongForRow(msgHdr.get(), &intKey);
               aValue.AppendInt(intKey);
             }
           }
           if (aValue.IsEmpty())
-            aValue.AssignLiteral("*");
+            aValue.Assign('*');
           break;
         }
 
         default:
           NS_ASSERTION(false, "we don't sort by group for this type");
           break;
       }
 
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -1558,19 +1558,19 @@ nsMsgDBFolder::GetRetentionSettings(nsIM
             rv = GetServer(getter_AddRefs(incomingServer));
             NS_IF_RELEASE(*settings);
             if (NS_SUCCEEDED(rv) && incomingServer)
               incomingServer->GetRetentionSettings(settings);
           }
           if (useServerRetention.EqualsLiteral("1") != useServerDefaults)
           {
             if (useServerDefaults)
-              useServerRetention.AssignLiteral("1");
+              useServerRetention.Assign('1');
             else
-              useServerRetention.AssignLiteral("0");
+              useServerRetention.Assign('0');
             SetStringProperty(kUseServerRetentionProp, useServerRetention);
           }
         }
       }
       else
         return NS_ERROR_FAILURE;
     }
     // Only cache the retention settings if we've overridden the server
@@ -1587,22 +1587,22 @@ nsMsgDBFolder::GetRetentionSettings(nsIM
 NS_IMETHODIMP nsMsgDBFolder::SetRetentionSettings(nsIMsgRetentionSettings *settings)
 {
   bool useServerDefaults;
   nsCString useServerRetention;
 
   settings->GetUseServerDefaults(&useServerDefaults);
   if (useServerDefaults)
   {
-    useServerRetention.AssignLiteral("1");
+    useServerRetention.Assign('1');
     m_retentionSettings = nullptr;
   }
   else
   {
-    useServerRetention.AssignLiteral("0");
+    useServerRetention.Assign('0');
     m_retentionSettings = settings;
   }
   SetStringProperty(kUseServerRetentionProp, useServerRetention);
   GetDatabase();
   if (mDatabase)
     mDatabase->SetMsgRetentionSettings(settings);
   return NS_OK;
 }
--- a/mailnews/base/util/nsMsgIdentity.cpp
+++ b/mailnews/base/util/nsMsgIdentity.cpp
@@ -74,17 +74,17 @@ nsMsgIdentity::GetIdentityName(nsAString
 
   // If a non-empty label exists, append it.
   nsString label;
   rv = GetLabel(label);
   if (NS_SUCCEEDED(rv) && !label.IsEmpty())
   { // TODO: this should be localizable
     idName.AppendLiteral(" (");
     idName.Append(label);
-    idName.AppendLiteral(")");
+    idName.Append(')');
   }
 
   if (!idName.IsEmpty())
     return NS_OK;
 
   // If we still found nothing to use, use our key.
   return ToString(idName);
 }
@@ -108,17 +108,17 @@ nsMsgIdentity::GetFullAddress(nsAString&
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIdentity::ToString(nsAString& aResult)
 {
   aResult.AssignLiteral("[nsIMsgIdentity: ");
   aResult.Append(NS_ConvertASCIItoUTF16(mKey));
-  aResult.AppendLiteral("]");
+  aResult.Append(']');
   return NS_OK;
 }
 
 /* Identity attribute accessors */
 
 NS_IMETHODIMP
 nsMsgIdentity::GetSignature(nsIFile **sig)
 {
@@ -243,17 +243,17 @@ nsMsgIdentity::GetDoBccList(nsACString& 
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsCString others;
   rv = GetBccList(others);
   NS_ENSURE_SUCCESS(rv,rv);
 
   if (bccOthers && !others.IsEmpty()) {
     if (bccSelf)
-      aValue.AppendLiteral(",");
+      aValue.Append(',');
     aValue.Append(others);
   }
 
   return SetDoBccList(aValue);
 }
 
 NS_IMETHODIMP
 nsMsgIdentity::SetDoBccList(const nsACString& aValue)
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -634,17 +634,17 @@ nsMsgIncomingServer::GetConstructedPrett
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgIncomingServer::ToString(nsAString& aResult)
 {
   aResult.AssignLiteral("[nsIMsgIncomingServer: ");
   aResult.Append(NS_ConvertASCIItoUTF16(m_serverKey));
-  aResult.AppendLiteral("]");
+  aResult.Append(']');
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgIncomingServer::SetPassword(const nsACString& aPassword)
 {
   m_password = aPassword;
   return NS_OK;
 }
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -260,34 +260,34 @@ nsresult NS_MsgGetPriorityFromString(
 
 nsresult NS_MsgGetPriorityValueString(
            const nsMsgPriorityValue p,
            nsACString & outValueString)
 {
   switch (p)
   {
     case nsMsgPriority::highest:
-      outValueString.AssignLiteral("1");
+      outValueString.Assign('1');
       break;
     case nsMsgPriority::high:
-      outValueString.AssignLiteral("2");
+      outValueString.Assign('2');
       break;
     case nsMsgPriority::normal:
-      outValueString.AssignLiteral("3");
+      outValueString.Assign('3');
       break;
     case nsMsgPriority::low:
-      outValueString.AssignLiteral("4");
+      outValueString.Assign('4');
       break;
     case nsMsgPriority::lowest:
-      outValueString.AssignLiteral("5");
+      outValueString.Assign('5');
       break;
     case nsMsgPriority::none:
     case nsMsgPriority::notSet:
       // Note: '0' is a "fake" value; we expect to never be in this case.
-      outValueString.AssignLiteral("0");
+      outValueString.Assign('0');
       break;
     default:
       NS_ASSERTION(false, "invalid priority value");
   }
 
   return NS_OK;
 }
 
@@ -580,17 +580,17 @@ nsresult FormatFileSize(int64_t size, bo
 #ifdef HAVE_LOCALECONV
     struct lconv *locale = localeconv();
     decimalPoint = locale->decimal_point;
 #else
     decimalPoint = getenv("LOCALE_DECIMAL_POINT");
 #endif
     NS_ConvertUTF8toUTF16 decimalSeparator(decimalPoint);
     if (decimalSeparator.IsEmpty())
-      decimalSeparator.AssignLiteral(".");
+      decimalSeparator.Assign('.');
 
     formattedSize.Replace(separatorPos, 1, decimalSeparator);
   }
 
   return NS_OK;
 }
 
 nsresult NS_MsgCreatePathStringFromFolderURI(const char *aFolderURI,
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -1156,17 +1156,17 @@ nsMsgAttachmentHandler::UrlExit(nsresult
       nsAutoCString unescapedUrl;
       MsgUnescapeString(turl, 0, unescapedUrl);
       if (unescapedUrl.IsEmpty())
         params = turl;
       else
         params = unescapedUrl;
     }
     else
-      params.AssignLiteral("?");
+      params.Assign('?');
 
     NS_ConvertUTF8toUTF16 UTF16params(params);
     const char16_t* formatParams[] = { UTF16params.get() };
     if (mode == nsIMsgSend::nsMsgSaveAsDraft || mode == nsIMsgSend::nsMsgSaveAsTemplate)
       bundle->FormatStringFromName(u"failureOnObjectEmbeddingWhileSaving",
                                    formatParams, 1, getter_Copies(msg));
     else
       bundle->FormatStringFromName(u"failureOnObjectEmbeddingWhileSending",
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -474,17 +474,17 @@ nsresult mime_generate_headers(nsIMsgCom
       nsAutoCString priorityValueString;
 
       NS_MsgGetPriorityValueString(priorityValue, priorityValueString);
       NS_MsgGetUntranslatedPriorityName(priorityValue, priorityName);
 
       // Output format: [X-Priority: <pValue> (<pName>)]
       priorityValueString.AppendLiteral(" (");
       priorityValueString += priorityName;
-      priorityValueString.AppendLiteral(")");
+      priorityValueString.Append(')');
       finalHeaders->SetRawHeader("X-Priority", priorityValueString, nullptr);
     }
   }
 
   nsAutoCString references;
   finalHeaders->GetRawHeader("References", references);
   if (!references.IsEmpty())
   {
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -1208,21 +1208,21 @@ nsMsgCompose::SendMsgToServer(MSG_Delive
       mozilla::services::GetObserverService();
     NS_ENSURE_STATE(observerService);
 
     // Assemble a string with sending parameters.
     nsAutoString sendParms;
 
     // First parameter: account key. This may be null.
     sendParms.AppendASCII(accountKey && *accountKey ? accountKey : "");
-    sendParms.AppendLiteral(",");
+    sendParms.Append(',');
 
     // Second parameter: deliverMode.
     sendParms.AppendInt(deliverMode);
-    sendParms.AppendLiteral(",");
+    sendParms.Append(',');
 
     // Third parameter: identity (as identity key).
     nsAutoCString identityKey;
     identity->GetKey(identityKey);
     sendParms.AppendASCII(identityKey.get());
 
     observerService->NotifyObservers(
       NS_ISUPPORTS_CAST(nsIMsgCompose*, this),
@@ -1962,27 +1962,27 @@ nsresult nsMsgCompose::CreateMessage(con
         uint16_t numReferences = 0;
         msgHdr->GetNumReferences(&numReferences);
         for (int32_t i = 0; i < numReferences; i++)
         {
           nsAutoCString ref;
           msgHdr->GetStringReference(i, ref);
           if (!ref.IsEmpty())
           {
-            reference.AppendLiteral("<");
+            reference.Append('<');
             reference.Append(ref);
             reference.AppendLiteral("> ");
           }
         }
         reference.Trim(" ", false, true);
       }
       msgHdr->GetMessageId(getter_Copies(messageId));
-      reference.AppendLiteral("<");
+      reference.Append('<');
       reference.Append(messageId);
-      reference.AppendLiteral(">");
+      reference.Append('>');
       m_compFields->SetReferences(reference.get());
     }
 
     // Early return for "Forward inline" and "Reply with template" processing.
     return NS_OK;
   }
 
   // All other processing.
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -389,17 +389,17 @@ void nsSmtpProtocol::AppendHelloArgument
 #endif
 
                   uint16_t family = nsINetAddr::FAMILY_INET;
                   iaddr->GetFamily(&family);
 
                   if (family == nsINetAddr::FAMILY_INET6) // IPv6 style address?
                       aResult.AppendLiteral("[IPv6:");
                   else
-                      aResult.AppendLiteral("[");
+                      aResult.Append('[');
 
                   aResult.Append(ipAddressString);
                   aResult.Append(']');
               }
           }
       }
   }
 }
--- a/mailnews/compose/src/nsSmtpServer.cpp
+++ b/mailnews/compose/src/nsSmtpServer.cpp
@@ -600,17 +600,17 @@ nsSmtpServer::GetServerURIInternal(const
     nsCString username;
     rv = GetUsername(username);
 
     if (NS_SUCCEEDED(rv) && !username.IsEmpty()) {
       nsCString escapedUsername;
       MsgEscapeString(username, nsINetUtil::ESCAPE_XALPHAS, escapedUsername);
       // not all servers have a username
       uri.Append(escapedUsername);
-      uri.AppendLiteral("@");
+      uri.Append('@');
     }
   }
 
   nsCString hostname;
   rv = GetHostname(hostname);
 
   if (NS_SUCCEEDED(rv) && !hostname.IsEmpty()) {
     nsCString escapedHostname;
--- a/mailnews/imap/src/nsIMAPNamespace.cpp
+++ b/mailnews/imap/src/nsIMAPNamespace.cpp
@@ -294,21 +294,21 @@ nsresult nsIMAPNamespaceList::SerializeN
   {
     serializedNamespaces.Assign(prefixes[0]);
     return NS_OK;
   }
 
   for (int i = 0; i < len; i++)
   {
     if (i > 0)
-      serializedNamespaces.AppendLiteral(",");
+      serializedNamespaces.Append(',');
 
-    serializedNamespaces.AppendLiteral("\"");
+    serializedNamespaces.Append('"');
     serializedNamespaces.Append(prefixes[i]);
-    serializedNamespaces.AppendLiteral("\"");
+    serializedNamespaces.Append('"');
   }
   return NS_OK;
 }
 
 /* str is the string which needs to be unserialized.
    If prefixes is NULL, simply returns the number of namespaces in str.  (len is ignored)
    If prefixes is not NULL, it should be an array of length len which is to be filled in
    with newly-allocated string.  Returns the number of strings filled in.
--- a/mailnews/imap/src/nsImapFlagAndUidState.cpp
+++ b/mailnews/imap/src/nsImapFlagAndUidState.cpp
@@ -257,17 +257,17 @@ NS_IMETHODIMP nsImapFlagAndUidState::Add
            (oldValue.CharAt(existingCustomFlagPos + customFlagLen) == ' ')) &&
            ((existingCustomFlagPos == 0) ||
             (oldValue.CharAt(existingCustomFlagPos - 1) == ' ')))
         return NS_OK;
       // else, advance to next flag
       existingCustomFlagPos = MsgFind(oldValue, customFlagString, false, existingCustomFlagPos + customFlagLen);
     }
     ourCustomFlags.Assign(oldValue);
-    ourCustomFlags.AppendLiteral(" ");
+    ourCustomFlags.Append(' ');
     ourCustomFlags.Append(customFlag);
     m_customFlagsHash.Remove(uid);
   }
   else
   {
     ourCustomFlags.Assign(customFlag);
   }
   m_customFlagsHash.Put(uid, ourCustomFlags);
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -7479,17 +7479,17 @@ void nsImapMailFolder::SetPendingAttribu
                             getter_Copies(dontPreserve));
   else
     prefBranch->GetCharPref("mailnews.database.summary.dontPreserveOnCopy",
                             getter_Copies(dontPreserve));
 
   // We'll add spaces at beginning and end so we can search for space-name-space
   nsCString dontPreserveEx(NS_LITERAL_CSTRING(" "));
   dontPreserveEx.Append(dontPreserve);
-  dontPreserveEx.AppendLiteral(" ");
+  dontPreserveEx.Append(' ');
 
   // these properties are set as integers below, so don't set them again
   // in the iteration through the properties
   dontPreserveEx.AppendLiteral("offlineMsgSize msgOffset flags priority pseudoHdr ");
 
   // these fields are either copied separately when the server does not support
   // custom IMAP flags, or managed directly through the flags
   dontPreserveEx.AppendLiteral("keywords label ");
@@ -7530,17 +7530,17 @@ void nsImapMailFolder::SetPendingAttribu
       nsAutoCString property;
       nsCString sourceString;
       bool hasMore;
       while (NS_SUCCEEDED(propertyEnumerator->HasMore(&hasMore)) && hasMore)
       {
         propertyEnumerator->GetNext(property);
         nsAutoCString propertyEx(NS_LITERAL_CSTRING(" "));
         propertyEx.Append(property);
-        propertyEx.AppendLiteral(" ");
+        propertyEx.Append(' ');
         if (dontPreserveEx.Find(propertyEx) != kNotFound)
           continue;
 
         nsCString sourceString;
         msgDBHdr->GetStringProperty(property.get(), getter_Copies(sourceString));
         mDatabase->SetAttributeOnPendingHdr(msgDBHdr, property.get(), sourceString.get());
       }
 
--- a/mailnews/import/outlook/src/MapiApi.cpp
+++ b/mailnews/import/outlook/src/MapiApi.cpp
@@ -1546,26 +1546,26 @@ void CMapiFolderList::AddItem(CMapiFolde
   EnsureUniqueName(pFolder);
   GenerateFilePath(pFolder);
   m_array.AppendElement(pFolder);
 }
 
 void CMapiFolderList::ChangeName(nsString& name)
 {
   if (name.IsEmpty()) {
-    name.AssignLiteral("1");
+    name.Assign('1');
     return;
   }
   char16_t lastC = name.Last();
   if ((lastC >= '0') && (lastC <= '9')) {
     lastC++;
     if (lastC > '9') {
       lastC = '1';
       name.SetCharAt(lastC, name.Length() - 1);
-      name.AppendLiteral("0");
+      name.Append('0');
     }
     else {
       name.SetCharAt(lastC, name.Length() - 1);
     }
   }
   else {
     name.AppendLiteral(" 2");
   }
--- a/mailnews/import/outlook/src/nsOutlookMail.cpp
+++ b/mailnews/import/outlook/src/nsOutlookMail.cpp
@@ -184,17 +184,17 @@ nsresult nsOutlookMail::GetMailFolders(n
   }
   array.forget(pArray);
   return NS_OK;
 }
 
 bool nsOutlookMail::IsAddressBookNameUnique(nsString& name, nsString& list)
 {
   nsString    usedName;
-  usedName.AppendLiteral("[");
+  usedName.Append('[');
   usedName.Append(name);
   usedName.AppendLiteral("],");
 
   return list.Find(usedName) == -1;
 }
 
 void nsOutlookMail::MakeAddressBookNameUnique(nsString& name, nsString& list)
 {
@@ -205,17 +205,17 @@ void nsOutlookMail::MakeAddressBookNameU
   while (!IsAddressBookNameUnique(newName, list)) {
     newName = name;
     newName.Append(char16_t(' '));
     newName.AppendInt((int32_t) idx);
     idx++;
   }
 
   name = newName;
-  list.AppendLiteral("[");
+  list.Append('[');
   list.Append(name);
   list.AppendLiteral("],");
 }
 
 nsresult nsOutlookMail::GetAddressBooks(nsIArray **pArray)
 {
   if (!m_haveMapi) {
     IMPORT_LOG0("GetAddressBooks called before Mapi is initialized\n");
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -2304,27 +2304,27 @@ nsMsgLocalMailFolder::CopyHdrPropertiesW
 {
   nsCOMPtr<nsIUTF8StringEnumerator> propertyEnumerator;
   nsresult rv = srcHdr->GetPropertyEnumerator(getter_AddRefs(propertyEnumerator));
   NS_ENSURE_SUCCESS_VOID(rv);
 
   // We'll add spaces at beginning and end so we can search for space-name-space
   nsCString dontPreserveEx(NS_LITERAL_CSTRING(" "));
   dontPreserveEx.Append(skipList);
-  dontPreserveEx.AppendLiteral(" ");
+  dontPreserveEx.Append(' ');
 
   nsAutoCString property;
   nsCString sourceString;
   bool hasMore;
   while (NS_SUCCEEDED(propertyEnumerator->HasMore(&hasMore)) && hasMore)
   {
     propertyEnumerator->GetNext(property);
     nsAutoCString propertyEx(NS_LITERAL_CSTRING(" "));
     propertyEx.Append(property);
-    propertyEx.AppendLiteral(" ");
+    propertyEx.Append(' ');
     if (dontPreserveEx.Find(propertyEx) != -1) // -1 is not found
       continue;
 
     srcHdr->GetStringProperty(property.get(), getter_Copies(sourceString));
     destHdr->SetStringProperty(property.get(), sourceString.get());
   }
 
   nsMsgLabelValue label = 0;
--- a/mailnews/local/src/nsPop3Protocol.cpp
+++ b/mailnews/local/src/nsPop3Protocol.cpp
@@ -1313,19 +1313,19 @@ nsPop3Protocol::Error(const char* err_co
                   CopyASCIItoUTF16(hostName, hostStr);
                   const char16_t *params[] = { hostStr.get() };
                   mLocalBundle->FormatStringFromName(
                     u"pop3ServerSaid",
                     params, 1, getter_Copies(serverSaidPrefix));
                 }
 
                 nsAutoString message(alertString);
-                message.AppendLiteral(" ");
+                message.Append(' ');
                 message.Append(serverSaidPrefix);
-                message.AppendLiteral(" ");
+                message.Append(' ');
                 message.Append(NS_ConvertASCIItoUTF16(m_commandResponse));
                 dialog->Alert(dialogTitle.get(), message.get());
               }
             }
         }
     }
     m_pop3ConData->next_state = POP3_ERROR_DONE;
     m_pop3ConData->pause_for_read = false;
--- a/mailnews/mapi/mapihook/src/msgMapiHook.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiHook.cpp
@@ -681,17 +681,17 @@ nsresult nsMapiHook::PopulateCompFieldsF
     if (strFilePaths.FindChar(',') != kNotFound) // if comma found in filenames return error
       return NS_ERROR_FILE_INVALID_PATH;
   }
 
   nsCString Attachments ;
 
   // only 1 file is to be sent, no delim specified
   if (strDelimChars.IsEmpty())
-      strDelimChars.AssignLiteral(";");
+      strDelimChars.Assign(';');
 
   int32_t offset = 0 ;
   int32_t FilePathsLen = strFilePaths.Length() ;
   if (FilePathsLen)
   {
     nsAutoString Subject ;
 
     // multiple files to be sent, delim specified
--- a/mailnews/mime/src/mimetpfl.cpp
+++ b/mailnews/mime/src/mimetpfl.cpp
@@ -575,17 +575,17 @@ static void Convert_whitespace(const cha
   }
 
   while(number_of_nbsp--) {
     a_out_string.AppendLiteral("&nbsp;");
   }
 
   while(number_of_space--) {
     // a_out_string += ' '; gives error
-    a_out_string.AppendLiteral(" ");
+    a_out_string.Append(' ');
   }
 
   return;
 }
 
 /**
  * Passes over the line and converts whitespace to |&nbsp;|, if appropriate
  *