Bug 1402750 - Replace [Assign|Append|Insert|Equals]("") with [Assign|Append|Insert|Equals]Literal(""). r=aceman
authorJorg K <jorgk@jorgk.com>
Mon, 25 Sep 2017 23:39:52 +0200
changeset 22207 fdc9f3574d6ece7b18d60bf6fe94b63324e9536d
parent 22206 eb81a4091d3cd18a78ba26caa8b62cd2945aa322
child 22208 337c6fe6e0e723bcf16be9ebfa3979d78e39166c
push id13553
push usermozilla@jorgk.com
push dateMon, 25 Sep 2017 23:35:01 +0000
treeherdercomm-central@2434e5fd8480 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman
bugs1402750
Bug 1402750 - Replace [Assign|Append|Insert|Equals]("") with [Assign|Append|Insert|Equals]Literal(""). r=aceman
mailnews/addrbook/src/nsAbAddressCollector.cpp
mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
mailnews/addrbook/src/nsAbCardProperty.cpp
mailnews/addrbook/src/nsAbLDAPDirectory.cpp
mailnews/addrbook/src/nsAbWinHelper.cpp
mailnews/base/search/src/nsMsgBodyHandler.cpp
mailnews/base/search/src/nsMsgFilterList.cpp
mailnews/base/search/src/nsMsgImapSearch.cpp
mailnews/base/search/src/nsMsgLocalSearch.cpp
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMessengerBootstrap.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgContentPolicy.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsMsgFolderDataSource.cpp
mailnews/base/src/nsMsgPrintEngine.cpp
mailnews/base/src/nsSpamSettings.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgI18N.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgMailNewsUrl.cpp
mailnews/base/util/nsMsgProtocol.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/compose/src/nsMsgAttachmentHandler.cpp
mailnews/compose/src/nsMsgCompUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgComposeService.cpp
mailnews/compose/src/nsMsgQuote.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/compose/src/nsMsgSendPart.cpp
mailnews/compose/src/nsSmtpProtocol.cpp
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
mailnews/imap/src/nsAutoSyncState.cpp
mailnews/imap/src/nsImapIncomingServer.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapProtocol.cpp
mailnews/imap/src/nsImapServerResponseParser.cpp
mailnews/imap/src/nsImapService.cpp
mailnews/imap/src/nsImapUndoTxn.cpp
mailnews/import/becky/src/nsBeckyMail.cpp
mailnews/import/becky/src/nsBeckySettings.cpp
mailnews/import/outlook/src/MapiMessage.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
mailnews/mime/emitters/nsMimeBaseEmitter.cpp
mailnews/mime/src/mimedrft.cpp
mailnews/mime/src/mimemoz2.cpp
mailnews/mime/src/mimemrel.cpp
mailnews/mime/src/mimetpla.cpp
mailnews/mime/src/nsStreamConverter.cpp
mailnews/news/src/nsNntpIncomingServer.cpp
mailnews/news/src/nsNntpService.cpp
--- a/mailnews/addrbook/src/nsAbAddressCollector.cpp
+++ b/mailnews/addrbook/src/nsAbAddressCollector.cpp
@@ -206,20 +206,20 @@ nsAbAddressCollector::AutoCollectScreenN
 
   if (domain.IsEmpty())
     return;
   // username in 
   // username@aol.com (America Online)
   // username@cs.com (Compuserve)
   // username@netscape.net (Netscape webmail)
   // are all AIM screennames.  autocollect that info.
-  if (domain.Equals("aol.com") || domain.Equals("cs.com") ||
-      domain.Equals("netscape.net"))
+  if (domain.EqualsLiteral("aol.com") || domain.EqualsLiteral("cs.com") ||
+      domain.EqualsLiteral("netscape.net"))
     aCard->SetPropertyAsAUTF8String(kScreenNameProperty, Substring(aEmail, 0, atPos));
-  else if (domain.Equals("gmail.com") || domain.Equals("googlemail.com"))
+  else if (domain.EqualsLiteral("gmail.com") || domain.EqualsLiteral("googlemail.com"))
     aCard->SetPropertyAsAUTF8String(kGtalkProperty, Substring(aEmail, 0, atPos));
 }
 
 // Returns true if the card was modified successfully.
 bool
 nsAbAddressCollector::SetNamesForCard(nsIAbCard *aSenderCard,
                                       const nsACString &aFullName)
 {
--- a/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
+++ b/mailnews/addrbook/src/nsAbBoolExprToLDAPFilter.cpp
@@ -63,17 +63,17 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
         nsCOMPtr<nsIAbBooleanConditionString>
             childCondition(do_QueryElementAt(childExpressions, 1, &rv));
         if (NS_SUCCEEDED(rv))
         {
             nsCString name;
             rv = childCondition->GetName (getter_Copies (name));
             NS_ENSURE_SUCCESS(rv, rv);
 
-            if(name.Equals("card:nsIAbCard"))
+            if (name.EqualsLiteral("card:nsIAbCard"))
                 return NS_OK;
         }
     }
 
     filter.AppendLiteral("(");
     switch (operation)
     {
         case nsIAbBooleanOperationTypes::AND:
@@ -170,17 +170,17 @@ nsresult nsAbBoolExprToLDAPFilter::Filte
         case nsIAbBooleanConditionTypes::Exists:
             filter.AppendLiteral("("); 
             filter.Append(ldapAttr);
             filter.AppendLiteral("=*)");
             break;
         case nsIAbBooleanConditionTypes::Contains:
             filter.AppendLiteral("(");
             filter.Append(ldapAttr);
-            filter.Append("=*");
+            filter.AppendLiteral("=*");
             filter.Append(vUTF8);
             filter.AppendLiteral("*)");
             break;
         case nsIAbBooleanConditionTypes::DoesNotContain:
             filter.AppendLiteral("(!(");
             filter.Append(ldapAttr);
             filter.AppendLiteral("=*");
             filter.Append(vUTF8);
--- a/mailnews/addrbook/src/nsAbCardProperty.cpp
+++ b/mailnews/addrbook/src/nsAbCardProperty.cpp
@@ -123,17 +123,17 @@ nsAbCardProperty::~nsAbCardProperty(void
 {
 }
 
 NS_IMPL_ISUPPORTS(nsAbCardProperty, nsIAbCard, nsIAbItem)
 
 NS_IMETHODIMP nsAbCardProperty::GetUuid(nsACString &uuid)
 {
   // If we have indeterminate sub-ids, return an empty uuid.
-  if (m_directoryId.Equals("") || m_localId.Equals(""))
+  if (m_directoryId.IsEmpty() || m_localId.IsEmpty())
   {
     uuid.Truncate();
     return NS_OK;
   }
 
   nsresult rv;
   nsCOMPtr<nsIAbManager> manager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPDirectory.cpp
@@ -239,20 +239,20 @@ NS_IMETHODIMP nsAbLDAPDirectory::SetLDAP
 
   rv = SetStringValue("uri", tempLDAPURL);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Now we need to send an update which will ensure our indicators and
   // listeners get updated correctly.
 
   // See if they both start with ldaps: or ldap:
-  bool newIsNotSecure = StringHead(tempLDAPURL, 5).Equals("ldap:");
+  bool newIsNotSecure = StringBeginsWith(tempLDAPURL, NS_LITERAL_CSTRING("ldap:"));
 
   if (oldUrl.IsEmpty() ||
-      StringHead(oldUrl, 5).Equals("ldap:") != newIsNotSecure)
+      StringBeginsWith(oldUrl, NS_LITERAL_CSTRING("ldap:")) != newIsNotSecure)
   {
     // They don't so its time to send round an update.
     nsCOMPtr<nsIAbManager> abManager = do_GetService(NS_ABMANAGER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // We inherit from nsIAbDirectory, so this static cast should be safe.
     abManager->NotifyItemPropertyChanged(static_cast<nsIAbDirectory*>(this),
       "IsSecure",
--- a/mailnews/addrbook/src/nsAbWinHelper.cpp
+++ b/mailnews/addrbook/src/nsAbWinHelper.cpp
@@ -984,17 +984,17 @@ nsAbWinType getAbWinType(const char *aSc
 }
 
 void buildAbWinUri(const char *aScheme, uint32_t aType, nsCString& aUri)
 {
     aUri.Assign(aScheme) ;
     switch(aType) {
     case nsAbWinType_Outlook: aUri.Append(kOutlookStub) ; break ; 
     case nsAbWinType_OutlookExp: aUri.Append(kOutlookExpStub) ; break ;
-    default: aUri.Assign("") ;
+    default: aUri.AssignLiteral("") ;
     }
 }
 
 
 
 
 
 
--- a/mailnews/base/search/src/nsMsgBodyHandler.cpp
+++ b/mailnews/base/search/src/nsMsgBodyHandler.cpp
@@ -388,17 +388,17 @@ void nsMsgBodyHandler::SniffPossibleMIME
     int32_t start = lowerCaseLine.Find("boundary=", /* ignoreCase = */ true);
     start += 9;
     if (line[start] == '\"')
       start++;
     int32_t end = line.RFindChar('\"');
     if (end == -1)
       end = line.Length();
 
-    boundary.Assign("--");
+    boundary.AssignLiteral("--");
     boundary.Append(Substring(line,start,end-start));
   }
 
   if (StringBeginsWith(lowerCaseLine,
                        NS_LITERAL_CSTRING("content-transfer-encoding:")) &&
       lowerCaseLine.Find(ENCODING_BASE64, /* ignoreCase = */ true) != kNotFound)
     m_base64part = true;
 }
--- a/mailnews/base/search/src/nsMsgFilterList.cpp
+++ b/mailnews/base/search/src/nsMsgFilterList.cpp
@@ -174,17 +174,17 @@ nsMsgFilterList::GetLogFile(nsIFile **aF
   NS_ENSURE_SUCCESS(rv,rv);
 
   // for news folders (not servers), the filter file is
   // mcom.test.dat
   // where the summary file is
   // mcom.test.msf
   // since the log is an html file we make it
   // mcom.test.htm
-  if (type.Equals("nntp") && !isServer)
+  if (type.EqualsLiteral("nntp") && !isServer)
   {
     nsCOMPtr<nsIFile> thisFolder;
     rv = m_folder->GetFilePath(getter_AddRefs(thisFolder));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIFile> filterLogFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = filterLogFile->InitWithFile(thisFolder);
@@ -400,17 +400,17 @@ int nsMsgFilterList::SkipWhitespace(nsII
     ch = ReadChar(aStream);
   } while (!(ch & 0x80) && isspace(ch)); // isspace can crash with non-ascii input
 
   return ch;
 }
 
 bool nsMsgFilterList::StrToBool(nsCString &str)
 {
-  return str.Equals("yes") ;
+  return str.EqualsLiteral("yes");
 }
 
 int nsMsgFilterList::LoadAttrib(nsMsgFilterFileAttribValue &attrib, nsIInputStream *aStream)
 {
   char  attribStr[100];
   int curChar;
   attrib = nsIMsgFilterList::attribNone;
 
@@ -1148,17 +1148,17 @@ nsresult nsMsgFilterList::ComputeArbitra
     {
       filter->GetTerm(i, &attrib, nullptr, nullptr, nullptr, arbitraryHeader);
       if (!arbitraryHeader.IsEmpty())
       {
         if (m_arbitraryHeaders.IsEmpty())
           m_arbitraryHeaders.Assign(arbitraryHeader);
         else if (m_arbitraryHeaders.Find(arbitraryHeader, /* ignoreCase = */ true) == -1)
         {
-          m_arbitraryHeaders.Append(" ");
+          m_arbitraryHeaders.Append(' ');
           m_arbitraryHeaders.Append(arbitraryHeader);
         }
       }
     }
   }
 
   return NS_OK;
 }
--- a/mailnews/base/search/src/nsMsgImapSearch.cpp
+++ b/mailnews/base/search/src/nsMsgImapSearch.cpp
@@ -124,17 +124,17 @@ nsresult nsMsgSearchOnlineMail::Encode (
 
   // We do not need "srcCharset" since the search term in always unicode.
   // I just pass destCharset for both src and dest charset instead of removing srcCharst from the arguemnt.
   nsresult err = nsMsgSearchAdapter::EncodeImap (getter_Copies(imapTerms), searchTerms,
     asciiOnly ?  usAsciiCharSet.get(): destCharset,
     asciiOnly ?  usAsciiCharSet.get(): destCharset, false);
   if (NS_SUCCEEDED(err))
   {
-    pEncoding.Append("SEARCH");
+    pEncoding.AppendLiteral("SEARCH");
     if (csname)
       pEncoding.Append(csname);
     pEncoding.Append(imapTerms);
   }
   PR_FREEIF(csname);
   return err;
 }
 
--- a/mailnews/base/search/src/nsMsgLocalSearch.cpp
+++ b/mailnews/base/search/src/nsMsgLocalSearch.cpp
@@ -435,17 +435,17 @@ nsresult nsMsgSearchOfflineMail::Process
         break;
       case nsMsgSearchAttrib::Subject:
       {
         msgToMatch->GetSubject(getter_Copies(matchString) /* , true */);
         if (msgFlags & nsMsgMessageFlags::HasRe)
         {
           // Make sure we pass along the "Re: " part of the subject if this is a reply.
           nsCString reString;
-          reString.Assign("Re: ");
+          reString.AssignLiteral("Re: ");
           reString.Append(matchString);
           err = aTerm->MatchRfc2047String(reString, charset, charsetOverride, &result);
         }
         else
           err = aTerm->MatchRfc2047String(matchString, charset, charsetOverride, &result);
         break;
       }
       case nsMsgSearchAttrib::ToOrCC:
@@ -547,17 +547,17 @@ nsresult nsMsgSearchOfflineMail::Process
           nsCString keywords;
           nsMsgLabelValue label;
           msgToMatch->GetStringProperty("keywords", getter_Copies(keywords));
           msgToMatch->GetLabel(&label);
           if (label >= 1)
           {
             if (!keywords.IsEmpty())
               keywords.Append(' ');
-            keywords.Append("$label");
+            keywords.AppendLiteral("$label");
             keywords.Append(label + '0');
           }
           err = aTerm->MatchKeyword(keywords, &result);
           break;
       }
       case nsMsgSearchAttrib::JunkStatus:
       {
          nsCString junkScoreStr;
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -509,17 +509,17 @@ nsresult nsMsgSearchTerm::OutputValue(ns
       {
         nsAutoCString priority;
         NS_MsgGetUntranslatedPriorityName(m_value.u.priority, priority);
         outputStr += priority;
         break;
       }
     case nsMsgSearchAttrib::HasAttachmentStatus:
       {
-        outputStr.Append("true");  // don't need anything here, really
+        outputStr.AppendLiteral("true");  // don't need anything here, really
         break;
       }
     case nsMsgSearchAttrib::Size:
       {
         outputStr.AppendInt(m_value.u.size);
         break;
       }
     case nsMsgSearchAttrib::Uint32HdrProperty:
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -2885,19 +2885,19 @@ nsDelAttachListener::StartProcessing(nsM
   const char * partId;
   const char * nextField;
   nsAutoCString sHeader("attach&del=");
   nsAutoCString detachToHeader("&detachTo=");
   for (uint32_t u = 0; u < mAttach->mCount; ++u)
   {
     if (u > 0)
     {
-      sHeader.Append(",");
+      sHeader.Append(',');
       if (detaching)
-        detachToHeader.Append(",");
+        detachToHeader.Append(',');
     }
     partId = GetAttachmentPartId(mAttach->mAttachmentArray[u].mUrl);
     nextField = PL_strchr(partId, '&');
     sHeader.Append(partId, nextField ? nextField - partId : -1);
     if (detaching)
       detachToHeader.Append(mDetachedFileUris[u]);
   }
 
--- a/mailnews/base/src/nsMessengerBootstrap.cpp
+++ b/mailnews/base/src/nsMessengerBootstrap.cpp
@@ -26,17 +26,17 @@ nsMessengerBootstrap::~nsMessengerBootst
 }
 
 NS_IMETHODIMP nsMessengerBootstrap::OpenMessengerWindowWithUri(const char *windowType, const char * aFolderURI, nsMsgKey aMessageKey)
 {
   bool standAloneMsgWindow = false;
   nsAutoCString chromeUrl("chrome://messenger/content/");
   if (windowType && !strcmp(windowType, "mail:messageWindow"))
   {
-    chromeUrl.Append("messageWindow.xul");
+    chromeUrl.AppendLiteral("messageWindow.xul");
     standAloneMsgWindow = true;
   }
   nsresult rv;
   nsCOMPtr<nsIMutableArray> argsArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // create scriptable versions of our strings that we can store in our nsIMutableArray....
   if (aFolderURI)
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -1298,17 +1298,17 @@ nsMsgAccountManager::LoadAccounts()
           nsCString dupAccountKey;
           dupAccount->GetKey(dupAccountKey);
           if (deferredToAccount.Equals(dupAccountKey))
           {
             nsresult rv;
             nsCString accountPref("mail.account.");
             nsCString dupAccountServerKey;
             accountPref.Append(dupAccountKey);
-            accountPref.Append(".server");
+            accountPref.AppendLiteral(".server");
             nsCOMPtr<nsIPrefService> prefservice(
               do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
             if (NS_FAILED(rv)) {
               continue;
             }
             nsCOMPtr<nsIPrefBranch> prefBranch(
               do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
             if (NS_FAILED(rv)) {
@@ -1317,17 +1317,17 @@ nsMsgAccountManager::LoadAccounts()
             rv = prefBranch->GetCharPref(accountPref.get(),
                                          getter_Copies(dupAccountServerKey));
             if (NS_FAILED(rv)) {
               continue;
             }
             nsCOMPtr<nsIPrefBranch> serverPrefBranch;
             nsCString serverKeyPref(PREF_MAIL_SERVER_PREFIX);
             serverKeyPref.Append(dupAccountServerKey);
-            serverKeyPref.Append(".");
+            serverKeyPref.Append('.');
             rv = prefservice->GetBranch(serverKeyPref.get(),
                                         getter_AddRefs(serverPrefBranch));
             if (NS_FAILED(rv)) {
               continue;
             }
             nsCString userName;
             nsCString hostName;
             nsCString type;
@@ -2945,17 +2945,17 @@ NS_IMETHODIMP nsMsgAccountManager::LoadV
       {
         if (version == -1)
         {
           buffer.Cut(0, 8);
           nsresult irv;
           version = buffer.ToInteger(&irv);
           continue;
         }
-        if (Substring(buffer, 0, 4).Equals("uri="))
+        if (StringBeginsWith(buffer, NS_LITERAL_CSTRING("uri=")))
         {
           buffer.Cut(0, 4);
           dbFolderInfo = nullptr;
 
           rv = rdf->GetResource(buffer, getter_AddRefs(resource));
           NS_ENSURE_SUCCESS(rv, rv);
 
           virtualFolder = do_QueryInterface(resource);
@@ -3009,37 +3009,37 @@ NS_IMETHODIMP nsMsgAccountManager::LoadV
                 parentFolder->GetIsServer(&isServer);
                 buffer.SetLength(lastSlash);
               }
               else
                 break;
             } while (!grandParent && !isServer);
           }
         }
-        else if (dbFolderInfo && Substring(buffer, 0, 6).Equals("scope="))
+        else if (dbFolderInfo && StringBeginsWith(buffer, NS_LITERAL_CSTRING("scope=")))
         {
           buffer.Cut(0, 6);
           // if this is a cross folder virtual folder, we have a list of folders uris,
           // and we have to add a pending listener for each of them.
           if (!buffer.IsEmpty())
           {
             ParseAndVerifyVirtualFolderScope(buffer, rdf);
             dbFolderInfo->SetCharProperty(kSearchFolderUriProp, buffer);
             AddVFListenersForVF(virtualFolder, buffer, rdf, msgDBService);
           }
         }
-        else if (dbFolderInfo && Substring(buffer, 0, 6).Equals("terms="))
+        else if (dbFolderInfo && StringBeginsWith(buffer, NS_LITERAL_CSTRING("terms=")))
         {
           buffer.Cut(0, 6);
           dbFolderInfo->SetCharProperty("searchStr", buffer);
         }
-        else if (dbFolderInfo && Substring(buffer, 0, 13).Equals("searchOnline="))
+        else if (dbFolderInfo && StringBeginsWith(buffer, NS_LITERAL_CSTRING("searchOnline=")))
         {
           buffer.Cut(0, 13);
-          dbFolderInfo->SetBooleanProperty("searchOnline", buffer.Equals("true"));
+          dbFolderInfo->SetBooleanProperty("searchOnline", buffer.EqualsLiteral("true"));
         }
         else if (dbFolderInfo &&
                  Substring(buffer, 0, SEARCH_FOLDER_FLAG_LEN + 1)
                    .Equals(SEARCH_FOLDER_FLAG"="))
         {
           buffer.Cut(0, SEARCH_FOLDER_FLAG_LEN + 1);
           dbFolderInfo->SetCharProperty(SEARCH_FOLDER_FLAG, buffer);
         }
--- a/mailnews/base/src/nsMsgContentPolicy.cpp
+++ b/mailnews/base/src/nsMsgContentPolicy.cpp
@@ -102,17 +102,17 @@ nsMsgContentPolicy::ShouldAcceptRemoteCo
   nsCString emailAddress;
   ExtractEmail(EncodedHeader(author), emailAddress);
   if (emailAddress.IsEmpty())
     return false;
 
   nsCOMPtr<nsIIOService> ios = do_GetService("@mozilla.org/network/io-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, false);
   nsCOMPtr<nsIURI> mailURI;
-  emailAddress.Insert("chrome://messenger/content/email=", 0);
+  emailAddress.InsertLiteral("chrome://messenger/content/email=", 0);
   rv = ios->NewURI(emailAddress, nullptr, nullptr, getter_AddRefs(mailURI));
   NS_ENSURE_SUCCESS(rv, false);
 
   // check with permission manager
   uint32_t permission = 0;
   rv = mPermissionManager->TestPermission(mailURI, "image", &permission);
   NS_ENSURE_SUCCESS(rv, false);
 
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -348,17 +348,17 @@ static void UpdateCachedName(nsIMsgDBHdr
   nsCString newCachedName;
   nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
   int32_t  currentDisplayNameVersion = 0;
 
   prefs->GetIntPref("mail.displayname.version", &currentDisplayNameVersion);
 
   // save version number
   newCachedName.AppendInt(currentDisplayNameVersion);
-  newCachedName.Append("|");
+  newCachedName.Append('|');
 
   // save name
   newCachedName.Append(NS_ConvertUTF16toUTF8(newName));
 
   aHdr->SetStringProperty(header_field,newCachedName.get());
 }
 
 nsresult nsMsgDBView::FetchAuthor(nsIMsgDBHdr * aHdr, nsAString &aSenderString)
--- a/mailnews/base/src/nsMsgFolderDataSource.cpp
+++ b/mailnews/base/src/nsMsgFolderDataSource.cpp
@@ -2064,17 +2064,17 @@ nsMsgFlatFolderDataSource::~nsMsgFlatFol
 }
 
 nsresult nsMsgFlatFolderDataSource::Init()
 {
   nsIRDFService* rdf = getRDFService();
   NS_ENSURE_TRUE(rdf, NS_ERROR_FAILURE);
   nsCOMPtr<nsIRDFResource> source;
   nsAutoCString dsUri(m_dsName);
-  dsUri.Append(":/");
+  dsUri.AppendLiteral(":/");
   rdf->GetResource(dsUri, getter_AddRefs(m_rootResource));
 
   return nsMsgFolderDataSource::Init();
 }
 
 void nsMsgFlatFolderDataSource::Cleanup()
 {
   m_folders.Clear();
--- a/mailnews/base/src/nsMsgPrintEngine.cpp
+++ b/mailnews/base/src/nsMsgPrintEngine.cpp
@@ -136,17 +136,17 @@ nsMsgPrintEngine::OnStateChange(nsIWebPr
           // Make sure this isn't just "about:blank" finishing....
           nsCOMPtr<nsIURI> originalURI = nullptr;
           if (NS_SUCCEEDED(aChannel->GetOriginalURI(getter_AddRefs(originalURI))) && originalURI)
           {
             nsAutoCString spec;
 
             if (NS_SUCCEEDED(originalURI->GetSpec(spec)))
             {
-              if (spec.Equals("about:blank"))
+              if (spec.EqualsLiteral("about:blank"))
               {
                 return StartNextPrintOperation();
               }
             }
           }
 
           // If something bad happens here (menaing we can fire the PLEvent, highly unlikely)
           // we will still ask the msg to print, but if the user "cancels" out of the
--- a/mailnews/base/src/nsSpamSettings.cpp
+++ b/mailnews/base/src/nsSpamSettings.cpp
@@ -529,17 +529,17 @@ NS_IMETHODIMP nsSpamSettings::GetSpamFol
   rv = folder->GetServer(getter_AddRefs(server));
   NS_ENSURE_SUCCESS(rv,rv);
 
   // see nsMsgFolder::SetPrettyName() for where the pretty name is set.
 
   // Check for an existing junk folder - this will do a case-insensitive
   // search by URI - if we find a junk folder, use its URI.
   nsCOMPtr<nsIMsgFolder> junkFolder;
-  folderURI.Append("/Junk");
+  folderURI.AppendLiteral("/Junk");
   if (NS_SUCCEEDED(server->GetMsgFolderFromURI(nullptr, folderURI,
                                                getter_AddRefs(junkFolder))) &&
       junkFolder)
     junkFolder->GetURI(folderURI);
 
   // XXX todo
   // better not to make base depend in imap
   // but doing it here, like in nsMsgCopy.cpp
@@ -578,17 +578,17 @@ NS_IMETHODIMP nsSpamSettings::SetServerF
 NS_IMETHODIMP nsSpamSettings::GetServerFilterFile(nsIFile ** aFile)
 {
   NS_ENSURE_ARG_POINTER(aFile);
   if (!mServerFilterFile)
   {
     nsresult rv;
     nsAutoCString serverFilterFileName;
     GetServerFilterName(serverFilterFileName);
-    serverFilterFileName.Append(".sfd");
+    serverFilterFileName.AppendLiteral(".sfd");
 
     nsCOMPtr<nsIProperties> dirSvc = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Walk through the list of isp directories
     nsCOMPtr<nsISimpleEnumerator> ispDirectories;
     rv = dirSvc->Get(ISP_DIRECTORY_LIST, NS_GET_IID(nsISimpleEnumerator), getter_AddRefs(ispDirectories));
     NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -1774,21 +1774,21 @@ nsresult nsMsgDBFolder::EndNewOfflineMes
          // this closes the stream
          msgStore->DiscardNewMessage(m_tempMessageStream, m_offlineHeader);
        else
          m_tempMessageStream->Close();
        m_tempMessageStream = nullptr;
 #ifdef _DEBUG
        nsAutoCString message("Offline message too small: messageSize=");
        message.AppendInt(messageSize);
-       message.Append(" curStorePos=");
+       message.AppendLiteral(" curStorePos=");
        message.AppendInt(curStorePos);
-       message.Append(" numOfflineMsgLines=");
+       message.AppendLiteral(" numOfflineMsgLines=");
        message.AppendInt(m_numOfflineMsgLines);
-       message.Append(" bytesAdded=");
+       message.AppendLiteral(" bytesAdded=");
        message.AppendInt(m_bytesAddedToLocalMsg);
        NS_ERROR(message.get());
 #endif
        m_offlineHeader = nullptr;
        return NS_ERROR_FAILURE;
     }
     else
       m_offlineHeader->SetLineCount(m_numOfflineMsgLines);
--- a/mailnews/base/util/nsMsgI18N.cpp
+++ b/mailnews/base/util/nsMsgI18N.cpp
@@ -135,34 +135,34 @@ const char * nsMsgI18NFileSystemCharset(
     nsresult rv;
     nsCOMPtr <nsIPlatformCharset> platformCharset = do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
         if (NS_SUCCEEDED(rv)) {
           rv = platformCharset->GetCharset(kPlatformCharsetSel_FileName,
                                            fileSystemCharset);
         }
 
     if (NS_FAILED(rv))
-      fileSystemCharset.Assign("ISO-8859-1");
+      fileSystemCharset.AssignLiteral("ISO-8859-1");
   }
   return fileSystemCharset.get();
 }
 
 // Charset used by the text file.
 void nsMsgI18NTextFileCharset(nsACString& aCharset)
 {
   nsresult rv;
   nsCOMPtr <nsIPlatformCharset> platformCharset =
     do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv)) {
     rv = platformCharset->GetCharset(kPlatformCharsetSel_PlainTextInFile,
                                      aCharset);
   }
 
   if (NS_FAILED(rv))
-    aCharset.Assign("ISO-8859-1");
+    aCharset.AssignLiteral("ISO-8859-1");
 }
 
 // MIME encoder, output string should be freed by PR_FREE
 // XXX : fix callers later to avoid allocation and copy
 char * nsMsgI18NEncodeMimePartIIStr(const char *header, bool structured, const char *charset, int32_t fieldnamelen, bool usemime)
 {
   // No MIME, convert to the outgoing mail charset.
   if (false == usemime) {
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -942,17 +942,17 @@ nsMsgIncomingServer::GetMsgStore(nsIMsgP
     // We don't want there to be a default pref, I think, since
     // we can't change the default. We may want no pref to mean
     // berkeley store, and then set the store pref off of some sort
     // of default when creating a server. But we need to make sure
     // that we do always write a store pref.
     GetCharValue("storeContractID", storeContractID);
     if (storeContractID.IsEmpty())
     {
-      storeContractID.Assign("@mozilla.org/msgstore/berkeleystore;1");
+      storeContractID.AssignLiteral("@mozilla.org/msgstore/berkeleystore;1");
       SetCharValue("storeContractID", storeContractID);
     }
 
     // After someone starts using the pluggable store, we can no longer
     // change the value.
     SetBoolValue("canChangeStoreType", false);
 
     // Right now, we just have one pluggable store per server. If we want
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -209,20 +209,20 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetServe
   rv = m_baseURL->GetSpec(urlstr);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = url->SetSpec(urlstr);
   if (NS_FAILED(rv)) return rv;
   rv = GetScheme(scheme);
     if (NS_SUCCEEDED(rv))
     {
         if (scheme.EqualsLiteral("pop"))
-          scheme.Assign("pop3");
+          scheme.AssignLiteral("pop3");
         // we use "nntp" in the server list so translate it here.
         if (scheme.EqualsLiteral("news"))
-          scheme.Assign("nntp");
+          scheme.AssignLiteral("nntp");
         url->SetScheme(scheme);
         nsCOMPtr<nsIMsgAccountManager> accountManager =
                  do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
         if (NS_FAILED(rv)) return rv;
 
         nsCOMPtr<nsIMsgIncomingServer> server;
         rv = accountManager->FindServerByURI(url, false,
                                         aIncomingServer);
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -99,17 +99,17 @@ nsMsgProtocol::GetQoSBits(uint8_t *aQoSB
   NS_ENSURE_ARG_POINTER(aQoSBits);
   const char* protocol = GetType();
 
   if (!protocol)
     return NS_ERROR_NOT_IMPLEMENTED;
 
   nsAutoCString prefName("mail.");
   prefName.Append(protocol);
-  prefName.Append(".qos");
+  prefName.AppendLiteral(".qos");
 
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
   int32_t val;
   rv = prefBranch->GetIntPref(prefName.get(), &val);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -129,18 +129,18 @@ nsresult GetMessageServiceContractIDForU
   //Find protocol
   nsAutoCString uriStr(uri);
   int32_t pos = uriStr.FindChar(':');
   if (pos == -1)
     return NS_ERROR_FAILURE;
 
   nsAutoCString protocol(StringHead(uriStr, pos));
 
-  if (protocol.Equals("file") && uriStr.Find("application/x-message-display") != -1)
-    protocol.Assign("mailbox");
+  if (protocol.EqualsLiteral("file") && uriStr.Find("application/x-message-display") != -1)
+    protocol.AssignLiteral("mailbox");
   //Build message service contractid
   contractID = "@mozilla.org/messenger/messageservice;1?type=";
   contractID += protocol.get();
 
   return rv;
 }
 
 nsresult GetMessageServiceFromURI(const nsACString& uri, nsIMsgMessageService **aMessageService)
@@ -1379,35 +1379,35 @@ nsresult GetSpecialDirectoryWithFileName
   return (*result)->AppendNative(nsDependentCString(fileName));
 }
 
 // Cleans up temp files with matching names
 nsresult MsgCleanupTempFiles(const char *fileName, const char *extension)
 {
   nsCOMPtr<nsIFile> tmpFile;
   nsCString rootName(fileName);
-  rootName.Append(".");
+  rootName.Append('.');
   rootName.Append(extension);
   nsresult rv = GetSpecialDirectoryWithFileName(NS_OS_TEMP_DIR,
                                                 rootName.get(),
                                                 getter_AddRefs(tmpFile));
 
   NS_ENSURE_SUCCESS(rv, rv);
   int index = 1;
   bool exists;
   do
   {
     tmpFile->Exists(&exists);
     if (exists)
     {
       tmpFile->Remove(false);
       nsCString leafName(fileName);
-      leafName.Append("-");
+      leafName.Append('-');
       leafName.AppendInt(index);
-      leafName.Append(".");
+      leafName.Append('.');
       leafName.Append(extension);
         // start with "Picture-1.jpg" after "Picture.jpg" exists
       tmpFile->SetNativeLeafName(leafName);
     }
   }
   while (exists && ++index < 10000);
   return NS_OK;
 }
--- a/mailnews/compose/src/nsMsgAttachmentHandler.cpp
+++ b/mailnews/compose/src/nsMsgAttachmentHandler.cpp
@@ -616,17 +616,17 @@ nsMsgAttachmentHandler::SnarfMsgAttachme
     }
 
     rv = fetcher->Initialize(mTmpFile, mOutFile, FetcherURLDoneCallback, this);
     rv = GetMessageServiceFromURI(m_uri, getter_AddRefs(messageService));
     if (NS_SUCCEEDED(rv) && messageService)
     {
       nsAutoCString uri(m_uri);
       uri += (uri.FindChar('?') == kNotFound) ? '?' : '&';
-      uri.Append("fetchCompleteMessage=true");
+      uri.AppendLiteral("fetchCompleteMessage=true");
       nsCOMPtr<nsIStreamListener> strListener = do_QueryInterface(fetcher);
 
       // initialize a new stream converter, that uses the strListener as its input
       // obtain the input stream listener from the new converter,
       // and pass the converter's input stream listener to DisplayMessage
 
       m_mime_parser = do_CreateInstance(NS_MAILNEWS_MIME_STREAM_CONVERTER_CONTRACTID, &rv);
       if (NS_FAILED(rv))
--- a/mailnews/compose/src/nsMsgCompUtils.cpp
+++ b/mailnews/compose/src/nsMsgCompUtils.cpp
@@ -607,38 +607,38 @@ mime_generate_attachment_headers (const 
     CopyUTF8toUTF16(nsDependentCString(real_name), realName);
     if (bodyCharset && *bodyCharset &&
         nsMsgI18Ncheck_data_in_charset_range(bodyCharset, realName.get()))
       charset.Assign(bodyCharset);
     else
     {
       charset.Assign(nsMsgI18NFileSystemCharset());
       if (!nsMsgI18Ncheck_data_in_charset_range(charset.get(), realName.get()))
-        charset.Assign("UTF-8"); // set to UTF-8 if fails again
+        charset.AssignLiteral("UTF-8"); // set to UTF-8 if fails again
     }
 
     encodedRealName = RFC2231ParmFolding("filename", charset, nullptr,
                                          realName);
     // somehow RFC2231ParamFolding failed. fall back to legacy method
     if (!encodedRealName || !*encodedRealName) {
       PR_FREEIF(encodedRealName);
       parmFolding = 0;
       // Not RFC 2231 style encoding (it's not standard-compliant)
       encodedRealName =
         LegacyParmFolding(charset, nsDependentCString(real_name), parmFolding);
     }
   }
 
   nsCString buf;  // very likely to be longer than 64 characters
-  buf.Append("Content-Type: ");
+  buf.AppendLiteral("Content-Type: ");
   buf.Append(type);
   if (type_param && *type_param)
   {
     if (*type_param != ';')
-      buf.Append("; ");
+      buf.AppendLiteral("; ");
     buf.Append(type_param);
   }
 
   if (mime_type_needs_charset (type))
   {
 
     char charset_label[65] = "";   // Content-Type: charset
     if (attachmentCharset)
@@ -675,143 +675,143 @@ mime_generate_attachment_headers (const 
          (PL_strcasecmp(type, TEXT_ENRICHED) == 0) ||
          (PL_strcasecmp(type, TEXT_VCARD) == 0) ||
          (PL_strcasecmp(type, APPLICATION_DIRECTORY) == 0) || /* text/x-vcard synonym */
          (PL_strcasecmp(type, TEXT_CSS) == 0) ||
          (PL_strcasecmp(type, TEXT_JSSS) == 0)) ||
          (PL_strcasecmp(encoding, ENCODING_BASE64) != 0)) &&
          (*charset_label))
     {
-      buf.Append("; charset=");
+      buf.AppendLiteral("; charset=");
       buf.Append(charset_label);
     }
   }
 
   // Only do this if we are in the body of a message
   if (aBodyDocument)
   {
     // Add format=flowed as in RFC 2646 if we are using that
     if(type && !PL_strcasecmp(type, "text/plain"))
     {
       bool flowed, delsp, formatted, disallowBreaks;
       GetSerialiserFlags(bodyCharset, &flowed, &delsp, &formatted, &disallowBreaks);
       if(flowed)
-        buf.Append("; format=flowed");
+        buf.AppendLiteral("; format=flowed");
       if (delsp)
-        buf.Append("; delsp=yes");
+        buf.AppendLiteral("; delsp=yes");
       // else
       // {
       // Don't add a markup. Could use
       //        PUSH_STRING ("; format=fixed");
       // but it is equivalent to nothing at all and we do want
       // to save bandwidth. Don't we?
       // }
     }
   }
 
   if (x_mac_type && *x_mac_type) {
-    buf.Append("; x-mac-type=\"");
+    buf.AppendLiteral("; x-mac-type=\"");
     buf.Append(x_mac_type);
-    buf.Append("\"");
+    buf.Append('"');
   }
 
   if (x_mac_creator && *x_mac_creator) {
-    buf.Append("; x-mac-creator=\"");
+    buf.AppendLiteral("; x-mac-creator=\"");
     buf.Append(x_mac_creator);
-    buf.Append("\"");
+    buf.Append('"');
   }
 
 #ifdef EMIT_NAME_IN_CONTENT_TYPE
   if (encodedRealName && *encodedRealName) {
     // Note that we don't need to output the name field if the name encoding is
     // RFC 2231. If the MUA knows the RFC 2231, it should know the RFC 2183 too.
     if (parmFolding != 2) {
       // The underlying JS MIME code will only handle UTF-8 here.
       char *nameValue = LegacyParmFolding(NS_LITERAL_CSTRING("UTF-8"),
                                           nsDependentCString(real_name),
                                           parmFolding);
       if (!nameValue || !*nameValue) {
         PR_FREEIF(nameValue);
         nameValue = encodedRealName;
       }
-      buf.Append(";\r\n name=\"");
+      buf.AppendLiteral(";\r\n name=\"");
       buf.Append(nameValue);
-      buf.Append("\"");
+      buf.Append('"');
       if (nameValue != encodedRealName)
         PR_FREEIF(nameValue);
     }
   }
 #endif /* EMIT_NAME_IN_CONTENT_TYPE */
   buf.Append(CRLF);
 
-  buf.Append("Content-Transfer-Encoding: ");
+  buf.AppendLiteral("Content-Transfer-Encoding: ");
   buf.Append(encoding);
   buf.Append(CRLF);
 
   if (description && *description) {
     char *s = mime_fix_header (description);
     if (s) {
-      buf.Append("Content-Description: ");
+      buf.AppendLiteral("Content-Description: ");
       buf.Append(s);
       buf.Append(CRLF);
       PR_Free(s);
     }
   }
 
   if ( (content_id) && (*content_id) )
   {
-    buf.Append("Content-ID: <");
+    buf.AppendLiteral("Content-ID: <");
     buf.Append(content_id);
-    buf.Append(">");
+    buf.Append('>');
     buf.Append(CRLF);
   }
 
   if (encodedRealName && *encodedRealName) {
     char *period = PL_strrchr(encodedRealName, '.');
     int32_t pref_content_disposition = 0;
 
     if (prefs) {
       mozilla::DebugOnly<nsresult> rv = prefs->GetIntPref("mail.content_disposition_type",
                                                           &pref_content_disposition);
       NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get mail.content_disposition_type");
     }
 
-    buf.Append("Content-Disposition: ");
+    buf.AppendLiteral("Content-Disposition: ");
 
     // If this is an attachment which is part of the message body and therefore has a
     // Content-ID (e.g, image in HTML msg), then Content-Disposition has to be inline
     if (content_id && *content_id)
-      buf.Append("inline");
+      buf.AppendLiteral("inline");
     else if (pref_content_disposition == 1)
-      buf.Append("attachment");
+      buf.AppendLiteral("attachment");
     else
       if (pref_content_disposition == 2 &&
           (!PL_strcasecmp(type, TEXT_PLAIN) ||
           (period && !PL_strcasecmp(period, ".txt"))))
-        buf.Append("attachment");
+        buf.AppendLiteral("attachment");
 
       /* If this document is an anonymous binary file or a vcard,
       then always show it as an attachment, never inline. */
       else
         if (!PL_strcasecmp(type, APPLICATION_OCTET_STREAM) ||
             !PL_strcasecmp(type, TEXT_VCARD) ||
             !PL_strcasecmp(type, APPLICATION_DIRECTORY)) /* text/x-vcard synonym */
-          buf.Append("attachment");
+          buf.AppendLiteral("attachment");
         else
-          buf.Append("inline");
+          buf.AppendLiteral("inline");
 
-    buf.Append(";\r\n ");
+    buf.AppendLiteral(";\r\n ");
     buf.Append(encodedRealName);
     buf.Append(CRLF);
   }
   else
     if (type &&
         (!PL_strcasecmp (type, MESSAGE_RFC822) ||
         !PL_strcasecmp (type, MESSAGE_NEWS)))
-      buf.Append("Content-Disposition: inline" CRLF);
+      buf.AppendLiteral("Content-Disposition: inline" CRLF);
 
 #ifdef GENERATE_CONTENT_BASE
   /* If this is an HTML document, and we know the URL it originally
      came from, write out a Content-Base header. */
   if (type &&
       (!PL_strcasecmp (type, TEXT_HTML) ||
       !PL_strcasecmp (type, TEXT_MDL)) &&
       base_url && *base_url)
@@ -835,54 +835,54 @@ mime_generate_attachment_headers (const 
 
     /* rhp - Put in a pref for using Content-Location instead of Content-Base.
            This will get tweaked to default to true in 5.0
     */
     if (prefs)
       prefs->GetBoolPref("mail.use_content_location_on_send", &useContentLocation);
 
     if (useContentLocation)
-      buf.Append("Content-Location: \"");
+      buf.AppendLiteral("Content-Location: \"");
     else
-      buf.Append("Content-Base: \"");
+      buf.AppendLiteral("Content-Base: \"");
     /* rhp - Pref for Content-Location usage */
 
 /* rhp: this is to work with the Content-Location stuff */
 CONTENT_LOC_HACK:
 
     while (*s != 0 && *s != '#')
     {
       uint32_t ot=buf.Length();
       char tmp[]="\x00\x00";
       /* URLs must be wrapped at 40 characters or less. */
       if (col >= 38) {
         buf.Append(CRLF "\t");
         col = 0;
       }
 
       if (*s == ' ')
-        buf.Append("%20");
+        buf.AppendLiteral("%20");
       else if (*s == '\t')
-        buf.Append("%09");
+        buf.AppendLiteral("%09");
       else if (*s == '\n')
-        buf.Append("%0A");
+        buf.AppendLiteral("%0A");
       else if (*s == '\r')
-        buf.Append("%0D");
+        buf.AppendLiteral("%0D");
       else {
 	      tmp[0]=*s;
 	      buf.Append(tmp);
       }
       s++;
       col += (buf.Length() - ot);
     }
-    buf.Append("\"" CRLF);
+    buf.AppendLiteral("\"" CRLF);
 
     /* rhp: this is to try to get around this fun problem with Content-Location */
     if (!useContentLocation) {
-      buf.Append("Content-Location: \"");
+      buf.AppendLiteral("Content-Location: \"");
       s = base_url;
       col = 0;
       useContentLocation = true;
       goto CONTENT_LOC_HACK;
     }
     /* rhp: this is to try to get around this fun problem with Content-Location */
 
 GIVE_UP_ON_CONTENT_BASE:
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -1784,17 +1784,17 @@ nsresult nsMsgCompose::CreateMessage(con
       // Remove possible trailing '?'.
       if (msgUri.CharAt(msgUri.Length() - 1) == '?')
         msgUri.Cut(msgUri.Length() - 1, 1);
     }
     else // we're dealing with a message/rfc822 attachment
     {
       // nsURLFetcher will check for "realtype=message/rfc822" and will set the
       // content type to message/rfc822 in the forwarded message.
-      msgUri.Append("&realtype=message/rfc822");
+      msgUri.AppendLiteral("&realtype=message/rfc822");
     }
     originalMsgURI = msgUri.get();
   }
 
   if (compFields)
   {
     m_compFields = reinterpret_cast<nsMsgCompFields*>(compFields);
   }
@@ -1878,19 +1878,19 @@ nsresult nsMsgCompose::CreateMessage(con
         msgDBHdr->GetStringProperty(QUEUED_DISPOSITION_PROPERTY, getter_Copies(queuedDisposition));
         // We need to retrieve the original URI from the database so we can
         // set the disposition flags correctly if the draft is a reply or forwarded message.
         nsCString originalMsgURIfromDB;
         msgDBHdr->GetStringProperty(ORIG_URI_PROPERTY, getter_Copies(originalMsgURIfromDB));
         mOriginalMsgURI = originalMsgURIfromDB;
         if (!queuedDisposition.IsEmpty())
         {
-          if (queuedDisposition.Equals("replied"))
+          if (queuedDisposition.EqualsLiteral("replied"))
              mDraftDisposition = nsIMsgFolder::nsMsgDispositionState_Replied;
-          else if (queuedDisposition.Equals("forward"))
+          else if (queuedDisposition.EqualsLiteral("forward"))
              mDraftDisposition = nsIMsgFolder::nsMsgDispositionState_Forwarded;
         }
       }
     }
   }
 
   // If we don't have an original message URI, nothing else to do...
   if (!originalMsgURI || *originalMsgURI == 0)
@@ -3392,17 +3392,17 @@ NS_IMETHODIMP nsMsgCompose::RememberQueu
   {
     mMsgSend->GetMessageKey(&msgKey);
     nsAutoCString msgUri(m_folderName);
     nsCString identityKey;
 
     m_identity->GetKey(identityKey);
 
     int32_t insertIndex = StringBeginsWith(msgUri, NS_LITERAL_CSTRING("mailbox")) ? 7 : 4;
-    msgUri.Insert("-message", insertIndex); // "mailbox/imap: -> "mailbox/imap-message:"
+    msgUri.InsertLiteral("-message", insertIndex); // "mailbox/imap: -> "mailbox/imap-message:"
     msgUri.Append('#');
     msgUri.AppendInt(msgKey);
     nsCOMPtr <nsIMsgDBHdr> msgHdr;
     rv = GetMsgDBHdrFromURI(msgUri.get(), getter_AddRefs(msgHdr));
     NS_ENSURE_SUCCESS(rv, rv);
     uint32_t pseudoHdrProp = 0;
     msgHdr->GetUint32Property("pseudoHdr", &pseudoHdrProp);
     if (pseudoHdrProp)
@@ -4167,23 +4167,23 @@ nsMsgCompose::LoadDataFromFile(nsIFile *
 
   readSize = (uint32_t) fileSize;
 
   nsAutoCString sigEncoding(nsMsgI18NParseMetaCharset(file));
   bool removeSigCharset = !sigEncoding.IsEmpty() && m_composeHTML;
 
   if (sigEncoding.IsEmpty()) {
     if (aAllowUTF8 && MsgIsUTF8(nsDependentCString(readBuf))) {
-      sigEncoding.Assign("UTF-8");
+      sigEncoding.AssignLiteral("UTF-8");
     }
     else if (sigEncoding.IsEmpty() && aAllowUTF16 &&
              readSize % 2 == 0 && readSize >= 2 &&
              ((readBuf[0] == char(0xFE) && readBuf[1] == char(0xFF)) ||
               (readBuf[0] == char(0xFF) && readBuf[1] == char(0xFE)))) {
-      sigEncoding.Assign("UTF-16");
+      sigEncoding.AssignLiteral("UTF-16");
     }
     else {
       //default to platform encoding for plain text files w/o meta charset
       nsAutoCString textFileCharset;
       nsMsgI18NTextFileCharset(textFileCharset);
       sigEncoding.Assign(textFileCharset);
     }
   }
--- a/mailnews/compose/src/nsMsgComposeService.cpp
+++ b/mailnews/compose/src/nsMsgComposeService.cpp
@@ -385,24 +385,24 @@ nsMsgComposeService::OpenComposeWindow(c
      Maybe one day when we will have more time we can change that
   */
   if (type == nsIMsgCompType::ForwardInline || type == nsIMsgCompType::Draft ||
       type == nsIMsgCompType::Template || type == nsIMsgCompType::ReplyWithTemplate ||
       type == nsIMsgCompType::Redirect || type == nsIMsgCompType::EditAsNew)
   {
     nsAutoCString uriToOpen(originalMsgURI);
     uriToOpen += (uriToOpen.FindChar('?') == kNotFound) ? '?' : '&';
-    uriToOpen.Append("fetchCompleteMessage=true");
+    uriToOpen.AppendLiteral("fetchCompleteMessage=true");
 
     // The compose type that gets transmitted to a compose window open in mime
     // is communicated using url query parameters here.
     if (type == nsIMsgCompType::Redirect)
-      uriToOpen.Append("&redirect=true");
+      uriToOpen.AppendLiteral("&redirect=true");
     else if (type == nsIMsgCompType::EditAsNew)
-      uriToOpen.Append("&editasnew=true");
+      uriToOpen.AppendLiteral("&editasnew=true");
 
     return LoadDraftOrTemplate(uriToOpen, type == nsIMsgCompType::ForwardInline || type == nsIMsgCompType::Draft ?
                                nsMimeOutput::nsMimeMessageDraftOrTemplate : nsMimeOutput::nsMimeMessageEditorTemplate,
                                identity, originalMsgURI, origMsgHdr, type == nsIMsgCompType::ForwardInline,
                                format == nsIMsgCompFormat::OppositeOfDefault, aMsgWindow);
   }
 
   nsCOMPtr<nsIMsgComposeParams> pMsgComposeParams (do_CreateInstance(NS_MSGCOMPOSEPARAMS_CONTRACTID, &rv));
@@ -1007,17 +1007,17 @@ nsMsgComposeService::ForwardMessage(cons
   nsCOMPtr<nsIMsgFolder> folder;
   aMsgHdr->GetFolder(getter_AddRefs(folder));
   NS_ENSURE_TRUE(folder, NS_ERROR_NULL_POINTER);
 
   folder->GetUriForMsg(aMsgHdr, msgUri);
 
   nsAutoCString uriToOpen(msgUri);
   uriToOpen += (uriToOpen.FindChar('?') == kNotFound) ? '?' : '&';
-  uriToOpen.Append("fetchCompleteMessage=true");
+  uriToOpen.AppendLiteral("fetchCompleteMessage=true");
 
   // get the MsgIdentity for the above key using AccountManager
   nsCOMPtr<nsIMsgAccountManager> accountManager =
     do_GetService (NS_MSGACCOUNTMANAGER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgAccount> account;
   nsCOMPtr<nsIMsgIdentity> identity;
--- a/mailnews/compose/src/nsMsgQuote.cpp
+++ b/mailnews/compose/src/nsMsgQuote.cpp
@@ -139,21 +139,21 @@ nsMsgQuote::QuoteMessage(const char *msg
   NS_ENSURE_SUCCESS(rv,rv);
 
   nsAutoCString queryPart;
   rv = mailNewsUrl->GetQuery(queryPart);
   if (!queryPart.IsEmpty())
     queryPart.Append('&');
 
   if (headersOnly) /* We don't need to quote the message body but we still need to extract the headers */
-    queryPart.Append("header=only");
+    queryPart.AppendLiteral("header=only");
   else if (quoteHeaders)
-    queryPart.Append("header=quote");
+    queryPart.AppendLiteral("header=quote");
   else
-    queryPart.Append("header=quotebody");
+    queryPart.AppendLiteral("header=quotebody");
   rv = mailNewsUrl->SetQuery(queryPart);
   NS_ENSURE_SUCCESS(rv,rv);
 
   // if we were given a non empty charset, then use it
   if (aMsgCharSet && *aMsgCharSet)
   {
     nsCOMPtr<nsIMsgI18NUrl> i18nUrl (do_QueryInterface(aURL));
     if (i18nUrl)
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -1080,17 +1080,17 @@ nsMsgComposeAndSend::PreProcessPart(nsMs
 
   nsCString type(ma->m_type);
   nsCString realName(ma->m_realName);
 
   // for cloud attachments, make the part an html part with no name,
   // so we don't show it as an attachment.
   if (ma->mSendViaCloud)
   {
-    type.Assign("application/octet-stream");
+    type.AssignLiteral("application/octet-stream");
     realName.Truncate();
   }
   hdrs = mime_generate_attachment_headers (type.get(),
                                            ma->m_typeParam.get(),
                                            ma->m_encoding.get(),
                                            ma->m_description.get(),
                                            ma->m_xMacType.get(),
                                            ma->m_xMacCreator.get(),
@@ -1122,22 +1122,22 @@ nsMsgComposeAndSend::PreProcessPart(nsMs
 
     // Need to add some headers so that libmime can restore the cloud info
     // when loading a draft message.
     nsCString draftInfo(HEADER_X_MOZILLA_CLOUD_PART": cloudFile; url=");
     draftInfo.Append(ma->mCloudUrl.get());
     // don't leak user file paths or account keys to recipients.
     if (m_deliver_mode == nsMsgSaveAsDraft)
     {
-      draftInfo.Append("; provider=");
+      draftInfo.AppendLiteral("; provider=");
       draftInfo.Append(ma->mCloudProviderKey.get());
-      draftInfo.Append("; file=");
+      draftInfo.AppendLiteral("; file=");
       draftInfo.Append(urlSpec.get());
     }
-    draftInfo.Append("; name=");
+    draftInfo.AppendLiteral("; name=");
     draftInfo.Append(ma->m_realName.get());
     draftInfo.Append(CRLF);
     part->AppendOtherHeaders(draftInfo.get());
     part->SetType("application/octet-stream");
     part->SetBuffer("");
   }
   if (NS_FAILED(status))
     return 0;
@@ -2104,34 +2104,34 @@ nsMsgComposeAndSend::AddCompFieldLocalAt
                 rv = fileUrl->SetFileName(m_attachments[newLoc]->m_realName);
                 if (NS_SUCCEEDED(rv))
                 {
                   rv = fileUrl->GetFileExtension(fileExt);
                   if (NS_SUCCEEDED(rv) && !fileExt.IsEmpty()) {
                     nsAutoCString type;
                     mimeFinder->GetTypeFromExtension(fileExt, type);
   #ifndef XP_MACOSX
-                    if (!type.Equals("multipart/appledouble"))  // can't do apple double on non-macs
+                    if (!type.EqualsLiteral("multipart/appledouble"))  // can't do apple double on non-macs
   #endif
                     m_attachments[newLoc]->m_type = type;
                   }
                 }
 
                 //Then try using the url if we still haven't figured out the content type
                 if (m_attachments[newLoc]->m_type.IsEmpty())
                 {
                   rv = fileUrl->SetSpec(url);
                   if (NS_SUCCEEDED(rv))
                   {
                     rv = fileUrl->GetFileExtension(fileExt);
                     if (NS_SUCCEEDED(rv) && !fileExt.IsEmpty()) {
                       nsAutoCString type;
                       mimeFinder->GetTypeFromExtension(fileExt, type);
   #ifndef XP_MACOSX
-                    if (!type.Equals("multipart/appledouble"))  // can't do apple double on non-macs
+                    if (!type.EqualsLiteral("multipart/appledouble"))  // can't do apple double on non-macs
   #endif
                       m_attachments[newLoc]->m_type = type;
                     // rtf and vcs files may look like text to sniffers,
                     // but they're not human readable.
                     if (type.IsEmpty() && !fileExt.IsEmpty() &&
                          (MsgLowerCaseEqualsLiteral(fileExt, "rtf") ||
                           MsgLowerCaseEqualsLiteral(fileExt, "vcs")))
                       m_attachments[newLoc]->m_type = APPLICATION_OCTET_STREAM;
@@ -2684,17 +2684,17 @@ nsMsgComposeAndSend::InitCompositionFiel
                 nsCOMPtr <nsIMsgIncomingServer> incomingServer;
                 rv = folder->GetServer(getter_AddRefs(incomingServer));
                 if (NS_SUCCEEDED(rv))
                 {
                   nsCString incomingServerType;
                   rv = incomingServer->GetCharValue("type", incomingServerType);
                   // Exclude RSS accounts, as they falsely report
                   // 'canFileMessages' = true
-                  if (NS_SUCCEEDED(rv) && !incomingServerType.Equals("rss"))
+                  if (NS_SUCCEEDED(rv) && !incomingServerType.EqualsLiteral("rss"))
                   {
                     bool fccReplyFollowsParent;
                     rv = mUserIdentity->GetFccReplyFollowsParent(
                              &fccReplyFollowsParent);
                     if (NS_SUCCEEDED(rv) && fccReplyFollowsParent)
                     {
                       nsCString folderURI;
                       rv = folder->GetURI(folderURI);
@@ -4425,17 +4425,17 @@ nsMsgComposeAndSend::MimeDoFCC(nsIFile  
       rv = accountManager->GetLocalFoldersServer(getter_AddRefs(server));
       if (NS_SUCCEEDED(rv) && server)
       {
         nsCOMPtr<nsIMsgFolder> rootFolder;
         rv = server->GetRootMsgFolder(getter_AddRefs(rootFolder));
         if (NS_SUCCEEDED(rv) && rootFolder)
         {
           rv = rootFolder->GetURI(folder);
-          folder.Append("/");
+          folder.Append('/');
         }
       }
     }
     if (NS_FAILED(rv) || folder.IsEmpty())
     {
       status = NS_ERROR_FAILURE;
       goto FAIL;
     }
@@ -4445,17 +4445,17 @@ nsMsgComposeAndSend::MimeDoFCC(nsIFile  
     {
       case nsMsgDeliverNow:
       case nsMsgSendUnsent:
       case nsMsgSaveAsDraft:
       case nsMsgSaveAsTemplate:
         // Typically, this appends "Sent-", "Drafts-" or "Templates-" to folder
         // and then has the account name appended, e.g., .../Sent-MyImapAccount.
         folder.Append(NS_ConvertUTF16toUTF8(mSavedToFolderName));
-        folder.Append("-");
+        folder.Append('-');
         break;
       default:
         status = NS_ERROR_FAILURE;
         goto FAIL;
     }
 
     // Get the account name where the "save to" failed.
     nsString accountName;
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -851,17 +851,17 @@ nsresult nsMsgSendLater::SetOrigMsgDispo
       if (msgHdr)
       {
         // get the folder for the message resource
         nsCOMPtr<nsIMsgFolder> msgFolder;
         msgHdr->GetFolder(getter_AddRefs(msgFolder));
         if (msgFolder)
         {
           nsMsgDispositionState dispositionSetting = nsIMsgFolder::nsMsgDispositionState_Replied;
-          if (queuedDisposition.Equals("forwarded"))
+          if (queuedDisposition.EqualsLiteral("forwarded"))
             dispositionSetting = nsIMsgFolder::nsMsgDispositionState_Forwarded;
 
           msgFolder->AddMessageDispositionState(msgHdr, dispositionSetting);
         }
       }
     }
   }
   return NS_OK;
--- a/mailnews/compose/src/nsMsgSendPart.cpp
+++ b/mailnews/compose/src/nsMsgSendPart.cpp
@@ -152,17 +152,17 @@ nsresult nsMsgSendPart::AddChild(nsMsgSe
   for (int i=0 ; i<m_numchildren-1 ; i++) {
     tmp[i] = m_children[i];
   }
   delete [] m_children;
   m_children = tmp;
   m_children[m_numchildren - 1] = child;
   child->m_parent = this;
   nsCString partNum(m_partNum);
-  partNum.Append(".");
+  partNum.Append('.');
   partNum.AppendInt(m_numchildren);
   child->m_partNum = partNum;
   return NS_OK;
 }
 
 nsMsgSendPart * nsMsgSendPart::DetachChild(int32_t whichOne)
 {
   nsMsgSendPart *returnValue = nullptr;
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -775,22 +775,22 @@ nsresult nsSmtpProtocol::SendHeloRespons
   }
 
   if (TestFlag(SMTP_EHLO_8BIT_ENABLED))
   {
     bool strictlyMime = false;
     rv = prefBranch->GetBoolPref("mail.strictly_mime", &strictlyMime);
 
     if (!strictlyMime)
-      buffer.Append(" BODY=8BITMIME");
+      buffer.AppendLiteral(" BODY=8BITMIME");
   }
 
   if (TestFlag(SMTP_EHLO_SIZE_ENABLED))
   {
-    buffer.Append(" SIZE=");
+    buffer.AppendLiteral(" SIZE=");
     buffer.AppendInt(m_totalMessageSize);
   }
   buffer += CRLF;
 
   status = SendData(buffer.get());
 
   m_nextState = SMTP_RESPONSE;
 
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -3413,17 +3413,17 @@ nsIMimeConverter *nsMsgDatabase::GetMime
 
 nsresult nsMsgDatabase::GetEffectiveCharset(nsIMdbRow *row, nsACString &resultCharset)
 {
   resultCharset.Truncate();
   bool characterSetOverride;
   m_dbFolderInfo->GetCharacterSetOverride(&characterSetOverride);
   nsresult rv = RowCellColumnToCharPtr(row, m_messageCharSetColumnToken, getter_Copies(resultCharset));
   if (NS_FAILED(rv) || resultCharset.IsEmpty() ||
-      resultCharset.Equals("us-ascii") || characterSetOverride)
+      resultCharset.EqualsLiteral("us-ascii") || characterSetOverride)
   {
     rv = m_dbFolderInfo->GetEffectiveCharacterSet(resultCharset);
   }
   return rv;
 }
 
 nsresult nsMsgDatabase::RowCellColumnToMime2DecodedString(nsIMdbRow *row, mdb_token columnToken, nsAString &resultStr)
 {
--- a/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
+++ b/mailnews/extensions/bayesian-spam-filter/src/nsBayesianFilter.cpp
@@ -493,17 +493,17 @@ void Tokenizer::tokenizeHeaders(nsIUTF8S
 
       if (headerProcessed)
         continue;
     }
 
     switch (headerName.First())
     {
     case 'c':
-        if (headerName.Equals("content-type"))
+        if (headerName.EqualsLiteral("content-type"))
         {
           nsresult rv;
           nsCOMPtr<nsIMIMEHeaderParam> mimehdrpar = do_GetService(NS_MIMEHEADERPARAM_CONTRACTID, &rv);
           if (NS_FAILED(rv))
             break;
 
           // extract the charset parameter
           nsCString parameterValue;
@@ -515,38 +515,38 @@ void Tokenizer::tokenizeHeaders(nsIUTF8S
           if (!parameterValue.Length())
             mimehdrpar->GetParameterInternal(headerValue.get(), nullptr /* use first unnamed param */, nullptr, nullptr, getter_Copies(parameterValue));
           addTokenForHeader("content-type/type", parameterValue);
 
           // XXX: should we add a token for the entire content-type header as well or just these parts we have extracted?
         }
         break;
     case 'r':
-      if (headerName.Equals("received"))
+      if (headerName.EqualsLiteral("received"))
       {
         // look for the string "may be forged" in the received headers. sendmail sometimes adds this hint
         // This does not compile on linux yet. Need to figure out why. Commenting out for now
         // if (FindInReadable(FORGED_RECEIVED_HEADER_HINT, headerValue))
         //   addTokenForHeader(headerName.get(), FORGED_RECEIVED_HEADER_HINT);
       }
 
       // leave out reply-to
       break;
     case 's':
-        if (headerName.Equals("subject"))
+        if (headerName.EqualsLiteral("subject"))
         {
           // we want to tokenize the subject
           addTokenForHeader(headerName.get(), headerValue, true);
         }
 
         // important: leave out sender field. Too strong of an indicator
         break;
     case 'x': // (2) X-Mailer / user-agent works best if it is untokenized, just fold the case and any leading/trailing white space
         // all headers beginning with x-mozilla are being changed by us, so ignore
-        if (Substring(headerName, 0, 9).Equals("x-mozilla"))
+        if (StringBeginsWith(headerName, NS_LITERAL_CSTRING("x-mozilla")))
           break;
         // fall through
         MOZ_FALLTHROUGH;
     case 'u':
         addTokenForHeader(headerName.get(), headerValue);
         break;
     default:
         addTokenForHeader(headerName.get(), headerValue);
--- a/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
+++ b/mailnews/extensions/mdn/src/nsMsgMdnGenerator.cpp
@@ -674,17 +674,17 @@ nsresult nsMsgMdnGenerator::CreateSecond
 
       if (!userAgentString.IsEmpty())
       {
         // Prepend the product name with the dns name according to RFC 3798.
         char hostName[256];
         PR_GetSystemInfo(PR_SI_HOSTNAME_UNTRUNCATED, hostName, sizeof hostName);
         if ((hostName[0] != '\0') && (strchr(hostName, '.') != NULL))
         {
-          userAgentString.Insert("; ", 0);
+          userAgentString.InsertLiteral("; ", 0);
           userAgentString.Insert(nsDependentCString(hostName), 0);
         }
 
         tmpBuffer = PR_smprintf("Reporting-UA: %s" CRLF,
                                 userAgentString.get());
         PUSH_N_FREE_STRING(tmpBuffer);
       }
     }
--- a/mailnews/imap/src/nsAutoSyncState.cpp
+++ b/mailnews/imap/src/nsAutoSyncState.cpp
@@ -508,17 +508,17 @@ NS_IMETHODIMP nsAutoSyncState::SetState(
       ownerFolder->GetFlags(&folderFlags);
       session->IsFolderOpenInWindow(ownerFolder, &folderOpen);
       if (!folderOpen && ! (folderFlags & nsMsgFolderFlags::Inbox))
         ownerFolder->SetMsgDatabase(nullptr);
     }
   }
   nsCString logStr("Sync State set to ");
   logStr.Append(stateStrings[aState]);
-  logStr.Append(" for ");
+  logStr.AppendLiteral(" for ");
   LogOwnerFolderName(logStr.get());
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAutoSyncState::TryCurrentGroupAgain(uint32_t aRetryCount)
 {
   SetState(stReadyToDownload);
 
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -1111,17 +1111,17 @@ NS_IMETHODIMP nsImapIncomingServer::Poss
   {
     tokenStr = StringHead(tempFolderName, slashPos);
     remStr = Substring(tempFolderName, slashPos);
   }
   else
     tokenStr.Assign(tempFolderName);
 
   if ((int32_t(PL_strcasecmp(tokenStr.get(), "INBOX"))==0) && (strcmp(tokenStr.get(), "INBOX") != 0))
-    changedStr.Append("INBOX");
+    changedStr.AppendLiteral("INBOX");
   else
     changedStr.Append(tokenStr);
 
   if (slashPos > 0 )
     changedStr.Append(remStr);
 
   dupFolderPath.Assign(changedStr);
   nsAutoCString folderName(dupFolderPath);
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -3248,17 +3248,17 @@ NS_IMETHODIMP nsImapMailFolder::BeginCop
     // be locking the previous temp file, and CreateUnique fails if the file
     // is locked. Use the message key to make a unique name.
     if (message)
     {
       nsCString tmpFileName("nscpmsg-");
       nsMsgKey msgKey;
       message->GetMessageKey(&msgKey);
       tmpFileName.AppendInt(msgKey);
-      tmpFileName.Append(".txt");
+      tmpFileName.AppendLiteral(".txt");
       m_copyState->m_tmpFile->SetNativeLeafName(tmpFileName);
       rv = m_copyState->m_tmpFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 00600);
       if (NS_FAILED(rv))
       {
         MOZ_LOG(IMAP, mozilla::LogLevel::Info, ("couldn't create temp nscpmsg.txt: %" PRIx32 "\n", static_cast<uint32_t>(rv)));
         OnCopyCompleted(m_copyState->m_srcSupport, rv);
         return rv;
       }
@@ -9080,17 +9080,17 @@ nsImapMailFolder::SetJunkScoreForMessage
 
   nsresult rv = nsMsgDBFolder::SetJunkScoreForMessages(aMessages, aJunkScore);
   if (NS_SUCCEEDED(rv))
   {
     nsAutoCString messageIds;
     nsTArray<nsMsgKey> keys;
     nsresult rv = BuildIdsAndKeyArray(aMessages, messageIds, keys);
     NS_ENSURE_SUCCESS(rv, rv);
-    StoreCustomKeywords(nullptr, aJunkScore.Equals("0") ? NS_LITERAL_CSTRING("NonJunk") : NS_LITERAL_CSTRING("Junk"), EmptyCString(), keys.Elements(),
+    StoreCustomKeywords(nullptr, aJunkScore.EqualsLiteral("0") ? NS_LITERAL_CSTRING("NonJunk") : NS_LITERAL_CSTRING("Junk"), EmptyCString(), keys.Elements(),
       keys.Length(), nullptr);
     if (mDatabase)
       mDatabase->Commit(nsMsgDBCommitType::kLargeCommit);
   }
   return rv;
 }
 
 NS_IMETHODIMP
@@ -9680,32 +9680,32 @@ NS_IMETHODIMP nsImapMailFolder::GetOffli
       nsCOMPtr<nsIMsgFolder> rootFolder;
       nsCOMPtr<nsIMsgImapMailFolder> subFolder;
       for (uint32_t i = 0; i < labelNames.Length(); i++)
       {
         rv = GetRootFolder(getter_AddRefs(rootFolder));
         if (NS_SUCCEEDED(rv) && (rootFolder))
         {
           nsCOMPtr<nsIMsgImapMailFolder> imapRootFolder = do_QueryInterface(rootFolder);
-          if (labelNames[i].Equals("\"\\\\Draft\""))
+          if (labelNames[i].EqualsLiteral("\"\\\\Draft\""))
              rv = rootFolder->GetFolderWithFlags(nsMsgFolderFlags::Drafts,
                                                  getter_AddRefs(subMsgFolder));
-          if (labelNames[i].Equals("\"\\\\Inbox\""))
+          if (labelNames[i].EqualsLiteral("\"\\\\Inbox\""))
              rv = rootFolder->GetFolderWithFlags(nsMsgFolderFlags::Inbox,
                                                  getter_AddRefs(subMsgFolder));
-          if (labelNames[i].Equals("\"\\\\All Mail\""))
+          if (labelNames[i].EqualsLiteral("\"\\\\All Mail\""))
              rv = rootFolder->GetFolderWithFlags(nsMsgFolderFlags::Archive,
                                                  getter_AddRefs(subMsgFolder));
-          if (labelNames[i].Equals("\"\\\\Trash\""))
+          if (labelNames[i].EqualsLiteral("\"\\\\Trash\""))
              rv = rootFolder->GetFolderWithFlags(nsMsgFolderFlags::Trash,
                                                  getter_AddRefs(subMsgFolder));
-          if (labelNames[i].Equals("\"\\\\Spam\""))
+          if (labelNames[i].EqualsLiteral("\"\\\\Spam\""))
              rv = rootFolder->GetFolderWithFlags(nsMsgFolderFlags::Junk,
                                                  getter_AddRefs(subMsgFolder));
-          if (labelNames[i].Equals("\"\\\\Sent\""))
+          if (labelNames[i].EqualsLiteral("\"\\\\Sent\""))
              rv = rootFolder->GetFolderWithFlags(nsMsgFolderFlags::SentMail,
                                                  getter_AddRefs(subMsgFolder));
           if (labelNames[i].Find("[Imap]/", /* ignoreCase = */ true) != kNotFound)
           {
             MsgReplaceSubstring(labelNames[i], "[Imap]/", "");
             imapRootFolder->FindOnlineSubFolder(labelNames[i], getter_AddRefs(subFolder));
             subMsgFolder = do_QueryInterface(subFolder);
           }
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -1438,17 +1438,17 @@ nsImapProtocol::ImapThreadMainLoop()
 
   MOZ_LOG(IMAP, LogLevel::Debug, ("ImapThreadMainLoop leaving [this=%p]\n", this));
 }
 
 void nsImapProtocol::HandleIdleResponses()
 {
   // int32_t oldRecent = GetServerStateParser().NumberOfRecentMessages();
   nsAutoCString commandBuffer(GetServerCommandTag());
-  commandBuffer.Append(" IDLE" CRLF);
+  commandBuffer.AppendLiteral(" IDLE" CRLF);
 
   do
   {
     ParseIMAPandCheckForNewMail(commandBuffer.get());
   }
   while (m_inputStreamBuffer->NextLineAvailable() && GetServerStateParser().Connected());
 
   //  if (oldRecent != GetServerStateParser().NumberOfRecentMessages())
@@ -1669,17 +1669,17 @@ bool nsImapProtocol::ProcessCurrentURL()
       {
         if (!DeathSignalReceived() && NS_SUCCEEDED(GetConnectionStatus()))
           AlertUserEventUsingName("imapServerNotImap4");
 
         SetConnectionStatus(NS_ERROR_FAILURE);        // stop netlib
       }
       else
       {
-        if ((m_connectionType.Equals("starttls")
+        if ((m_connectionType.EqualsLiteral("starttls")
              && (m_socketType == nsMsgSocketType::trySTARTTLS
              && (GetServerStateParser().GetCapabilityFlag() & kHasStartTLSCapability)))
             || m_socketType == nsMsgSocketType::alwaysSTARTTLS)
         {
           StartTLS();
           if (GetServerStateParser().LastCommandSuccessful())
           {
             nsCOMPtr<nsISupports> secInfo;
@@ -2854,24 +2854,24 @@ void nsImapProtocol::ProcessSelectedStat
 
           m_runningUrl->GetListOfMessageIds(messageIdString);
           m_runningUrl->GetCustomAddFlags(addFlags);
           m_runningUrl->GetCustomSubtractFlags(subtractFlags);
           if (!addFlags.IsEmpty())
           {
             nsAutoCString storeString("+FLAGS (");
             storeString.Append(addFlags);
-            storeString.Append(")");
+            storeString.Append(')');
             Store(messageIdString, storeString.get(), true);
           }
           if (!subtractFlags.IsEmpty())
           {
             nsAutoCString storeString("-FLAGS (");
             storeString.Append(subtractFlags);
-            storeString.Append(")");
+            storeString.Append(')');
             Store(messageIdString, storeString.get(), true);
           }
         }
         break;
       case nsIImapUrl::nsImapDeleteMsg:
         {
           nsCString messageIdString;
           m_runningUrl->GetListOfMessageIds(messageIdString);
@@ -3249,21 +3249,21 @@ void nsImapProtocol::SelectMailbox(const
   ProgressEventFunctionUsingNameWithString("imapStatusSelectingMailbox", mailboxName);
   IncrementCommandTagNumber();
 
   m_closeNeededBeforeSelect = false;   // initial value
   GetServerStateParser().ResetFlagInfo();
   nsCString escapedName;
   CreateEscapedMailboxName(mailboxName, escapedName);
   nsCString commandBuffer(GetServerCommandTag());
-  commandBuffer.Append(" select \"");
+  commandBuffer.AppendLiteral(" select \"");
   commandBuffer.Append(escapedName.get());
-  commandBuffer.Append("\"");
+  commandBuffer.Append('"');
   if (UseCondStore())
-    commandBuffer.Append(" (CONDSTORE)");
+    commandBuffer.AppendLiteral(" (CONDSTORE)");
   commandBuffer.Append(CRLF);
 
   nsresult res;
   res = SendData(commandBuffer.get());
   if (NS_FAILED(res)) return;
   ParseIMAPandCheckForNewMail();
 
   int32_t numOfMessagesInFlagState = 0;
@@ -3284,21 +3284,21 @@ void nsImapProtocol::SelectMailbox(const
 
 // Please call only with a single message ID
 void nsImapProtocol::Bodystructure(const nsCString &messageId, bool idIsUid)
 {
   IncrementCommandTagNumber();
 
   nsCString commandString(GetServerCommandTag());
   if (idIsUid)
-    commandString.Append(" UID");
-  commandString.Append(" fetch ");
+    commandString.AppendLiteral(" UID");
+  commandString.AppendLiteral(" fetch ");
 
   commandString.Append(messageId);
-  commandString.Append(" (BODYSTRUCTURE)" CRLF);
+  commandString.AppendLiteral(" (BODYSTRUCTURE)" CRLF);
 
   nsresult rv = SendData(commandString.get());
   if (NS_SUCCEEDED(rv))
       ParseIMAPandCheckForNewMail(commandString.get());
 }
 
 void nsImapProtocol::PipelinedFetchMessageParts(const char *uid, nsIMAPMessagePartIDArray *parts)
 {
@@ -3310,75 +3310,75 @@ void nsImapProtocol::PipelinedFetchMessa
   while ((parts->GetNumParts() > currentPartNum) && !DeathSignalReceived())
   {
     nsIMAPMessagePartID *currentPart = parts->GetPart(currentPartNum);
     if (currentPart)
     {
       // Do things here depending on the type of message part
       // Append it to the fetch string
       if (currentPartNum > 0)
-        stringToFetch.Append(" ");
+        stringToFetch.Append(' ');
 
       switch (currentPart->GetFields())
       {
       case kMIMEHeader:
         what = "BODY.PEEK[";
         what.Append(currentPart->GetPartNumberString());
-        what.Append(".MIME]");
+        what.AppendLiteral(".MIME]");
         stringToFetch.Append(what);
         break;
       case kRFC822HeadersOnly:
         if (currentPart->GetPartNumberString())
         {
           what = "BODY.PEEK[";
           what.Append(currentPart->GetPartNumberString());
-          what.Append(".HEADER]");
+          what.AppendLiteral(".HEADER]");
           stringToFetch.Append(what);
         }
         else
         {
           // headers for the top-level message
-          stringToFetch.Append("BODY.PEEK[HEADER]");
+          stringToFetch.AppendLiteral("BODY.PEEK[HEADER]");
         }
         break;
       default:
         NS_ASSERTION(false, "we should only be pipelining MIME headers and Message headers");
         break;
       }
     }
     currentPartNum++;
   }
 
   // Run the single, pipelined fetch command
   if ((parts->GetNumParts() > 0) && !DeathSignalReceived() && !GetPseudoInterrupted() && stringToFetch.get())
   {
       IncrementCommandTagNumber();
 
     nsCString commandString(GetServerCommandTag());
-    commandString.Append(" UID fetch ");
+    commandString.AppendLiteral(" UID fetch ");
     commandString.Append(uid, 10);
-    commandString.Append(" (");
+    commandString.AppendLiteral(" (");
     commandString.Append(stringToFetch);
-    commandString.Append(")" CRLF);
+    commandString.AppendLiteral(")" CRLF);
     nsresult rv = SendData(commandString.get());
         if (NS_SUCCEEDED(rv))
             ParseIMAPandCheckForNewMail(commandString.get());
   }
 }
 
 void nsImapProtocol::FetchMsgAttribute(const nsCString &messageIds, const nsCString &attribute)
 {
     IncrementCommandTagNumber();
 
     nsAutoCString commandString (GetServerCommandTag());
-    commandString.Append(" UID fetch ");
+    commandString.AppendLiteral(" UID fetch ");
     commandString.Append(messageIds);
-    commandString.Append(" (");
+    commandString.AppendLiteral(" (");
     commandString.Append(attribute);
-    commandString.Append(")" CRLF);
+    commandString.AppendLiteral(")" CRLF);
     nsresult rv = SendData(commandString.get());
 
     if (NS_SUCCEEDED(rv))
        ParseIMAPandCheckForNewMail(commandString.get());
     GetServerStateParser().SetFetchingFlags(false);
     // Always clear this flag after every fetch.
     m_fetchingWholeMessage = false;
 }
@@ -3423,38 +3423,38 @@ nsImapProtocol::FetchMessage(const nsCSt
     MOZ_LOG(IMAP, LogLevel::Debug, ("FetchMessage everything: curFetchSize %u numBytes %u",
                                 m_curFetchSize, numBytes));
     if (numBytes > 0)
       m_curFetchSize = numBytes;
 
     if (GetServerStateParser().ServerHasIMAP4Rev1Capability())
     {
       if (GetServerStateParser().GetCapabilityFlag() & kHasXSenderCapability)
-        commandString.Append(" %s (XSENDER UID RFC822.SIZE BODY[]");
+        commandString.AppendLiteral(" %s (XSENDER UID RFC822.SIZE BODY[]");
       else
-        commandString.Append(" %s (UID RFC822.SIZE BODY[]");
+        commandString.AppendLiteral(" %s (UID RFC822.SIZE BODY[]");
     }
     else
     {
       if (GetServerStateParser().GetCapabilityFlag() & kHasXSenderCapability)
-        commandString.Append(" %s (XSENDER UID RFC822.SIZE RFC822");
+        commandString.AppendLiteral(" %s (XSENDER UID RFC822.SIZE RFC822");
       else
-        commandString.Append(" %s (UID RFC822.SIZE RFC822");
+        commandString.AppendLiteral(" %s (UID RFC822.SIZE RFC822");
     }
     if (numBytes > 0)
     {
       // if we are retrieving chunks
       char *byterangeString = PR_smprintf("<%ld.%ld>",startByte, numBytes);
       if (byterangeString)
       {
         commandString.Append(byterangeString);
         PR_Free(byterangeString);
       }
     }
-    commandString.Append(")");
+    commandString.Append(')');
 
     break;
 
   case kEveryThingRFC822Peek:
     {
       MOZ_LOG(IMAP, LogLevel::Debug, ("FetchMessage peek: curFetchSize %u numBytes %u",
                                   m_curFetchSize, numBytes));
       if (numBytes > 0)
@@ -3485,17 +3485,17 @@ nsImapProtocol::FetchMessage(const nsCSt
         // if we are retrieving chunks
         char *byterangeString = PR_smprintf("<%ld.%ld>",startByte, numBytes);
         if (byterangeString)
         {
           commandString.Append(byterangeString);
           PR_Free(byterangeString);
         }
       }
-      commandString.Append(")");
+      commandString.Append(')');
     }
     break;
   case kHeadersRFC822andUid:
     if (GetServerStateParser().ServerHasIMAP4Rev1Capability())
     {
       eIMAPCapabilityFlags server_capabilityFlags = GetServerStateParser().GetCapabilityFlag();
       bool aolImapServer = ((server_capabilityFlags & kAOLImapCapability) != 0);
       bool downloadAllHeaders = false;
@@ -3534,98 +3534,98 @@ nsImapProtocol::FetchMessage(const nsCSt
 
         if (gUseEnvelopeCmd)
           what = PR_smprintf(" ENVELOPE BODY.PEEK[HEADER.FIELDS (%s)])", headersToDL);
         else
           what = PR_smprintf(" BODY.PEEK[HEADER.FIELDS (%s)])",headersToDL);
         NS_Free(headersToDL);
         if (what)
         {
-          commandString.Append(" %s (UID ");
+          commandString.AppendLiteral(" %s (UID ");
            if (m_isGmailServer)
-            commandString.Append("X-GM-MSGID X-GM-THRID X-GM-LABELS ");
+            commandString.AppendLiteral("X-GM-MSGID X-GM-THRID X-GM-LABELS ");
           if (aolImapServer)
-            commandString.Append(" XAOL.SIZE") ;
+            commandString.AppendLiteral(" XAOL.SIZE") ;
           else
-            commandString.Append("RFC822.SIZE");
-          commandString.Append(" FLAGS");
+            commandString.AppendLiteral("RFC822.SIZE");
+          commandString.AppendLiteral(" FLAGS");
           commandString.Append(what);
           PR_Free(what);
         }
         else
         {
-          commandString.Append(" %s (UID RFC822.SIZE BODY.PEEK[HEADER] FLAGS)");
+          commandString.AppendLiteral(" %s (UID RFC822.SIZE BODY.PEEK[HEADER] FLAGS)");
         }
       }
       else
-        commandString.Append(" %s (UID RFC822.SIZE BODY.PEEK[HEADER] FLAGS)");
+        commandString.AppendLiteral(" %s (UID RFC822.SIZE BODY.PEEK[HEADER] FLAGS)");
     }
     else
-      commandString.Append(" %s (UID RFC822.SIZE RFC822.HEADER FLAGS)");
+      commandString.AppendLiteral(" %s (UID RFC822.SIZE RFC822.HEADER FLAGS)");
     break;
   case kUid:
-    commandString.Append(" %s (UID)");
+    commandString.AppendLiteral(" %s (UID)");
     break;
   case kFlags:
     GetServerStateParser().SetFetchingFlags(true);
-    commandString.Append(" %s (FLAGS)");
+    commandString.AppendLiteral(" %s (FLAGS)");
     break;
   case kRFC822Size:
-    commandString.Append(" %s (RFC822.SIZE)");
+    commandString.AppendLiteral(" %s (RFC822.SIZE)");
     break;
   case kBodyStart:
     {
       int32_t numBytesToFetch;
       m_runningUrl->GetNumBytesToFetch(&numBytesToFetch);
 
-      commandString.Append(" %s (UID BODY.PEEK[HEADER.FIELDS (Content-Type Content-Transfer-Encoding)] BODY.PEEK[TEXT]<0.");
+      commandString.AppendLiteral(" %s (UID BODY.PEEK[HEADER.FIELDS (Content-Type Content-Transfer-Encoding)] BODY.PEEK[TEXT]<0.");
       commandString.AppendInt(numBytesToFetch);
-      commandString.Append(">)");
+      commandString.AppendLiteral(">)");
     }
     break;
   case kRFC822HeadersOnly:
     if (GetServerStateParser().ServerHasIMAP4Rev1Capability())
     {
       if (part)
       {
-        commandString.Append(" %s (BODY[");
+        commandString.AppendLiteral(" %s (BODY[");
         char *what = PR_smprintf("%s.HEADER])", part);
         if (what)
         {
           commandString.Append(what);
           PR_Free(what);
         }
         else
           HandleMemoryFailure();
       }
       else
       {
         // headers for the top-level message
-        commandString.Append(" %s (BODY[HEADER])");
+        commandString.AppendLiteral(" %s (BODY[HEADER])");
       }
     }
     else
-      commandString.Append(" %s (RFC822.HEADER)");
+      commandString.AppendLiteral(" %s (RFC822.HEADER)");
     break;
   case kMIMEPart:
-    commandString.Append(" %s (BODY.PEEK[%s]");
+    commandString.AppendLiteral(" %s (BODY.PEEK[%s]");
     if (numBytes > 0)
     {
       // if we are retrieving chunks
       char *byterangeString = PR_smprintf("<%ld.%ld>",startByte, numBytes);
       if (byterangeString)
       {
         commandString.Append(byterangeString);
         PR_Free(byterangeString);
       }
     }
-    commandString.Append(")");
+    commandString.Append(')');
     break;
   case kMIMEHeader:
-    commandString.Append(" %s (BODY[%s.MIME])");
+    commandString.AppendLiteral(" %s (BODY[%s.MIME])");
     break;
   }
 
   if (fetchModifier)
     commandString.Append(fetchModifier);
 
   commandString.Append(CRLF);
 
@@ -4194,17 +4194,17 @@ void nsImapProtocol::ProcessMailboxUpdat
     {
       uint32_t highestRecordedUID = GetServerStateParser().HighestRecordedUID();
       // if we're using CONDSTORE, and the parser hasn't seen any UIDs, use
       // the highest UID we've seen from the folder.
       if (UseCondStore() && !highestRecordedUID)
         highestRecordedUID = mFolderHighestUID;
 
       AppendUid(fetchStr, highestRecordedUID + 1);
-      fetchStr.Append(":*");
+      fetchStr.AppendLiteral(":*");
       FetchMessage(fetchStr, kFlags);      // only new messages please
     }
   }
   else if (GetServerStateParser().LastCommandSuccessful())
   {
     GetServerStateParser().ResetFlagInfo();
     // the flag state is empty, but not partial.
     m_flagState->SetPartialUIDFetch(false);
@@ -4422,17 +4422,17 @@ void nsImapProtocol::PeriodicBiff()
 
       deleted = m_flagState->NumberOfDeletedMessages();
       added = numMessages;
       if (!added || (added == deleted)) // empty keys, get them all
         id = 1;
 
       //sprintf(fetchStr, "%ld:%ld", id, id + GetServerStateParser().NumberOfMessages() - fFlagState->GetNumberOfMessages());
       AppendUid(fetchStr, id);
-      fetchStr.Append(":*");
+      fetchStr.AppendLiteral(":*");
       FetchMessage(fetchStr, kFlags);
       if (((uint32_t) m_flagState->GetHighestNonDeletedUID() >= id) && m_flagState->IsLastMessageUnseen())
         m_currentBiffState = nsIMsgFolder::nsMsgBiffState_NewMail;
       else
         m_currentBiffState = nsIMsgFolder::nsMsgBiffState_NoMail;
     }
     else
       m_currentBiffState = nsIMsgFolder::nsMsgBiffState_NoMail;
@@ -5371,17 +5371,17 @@ nsImapProtocol::IssueUserDefinedMsgComma
     HandleMemoryFailure();
 }
 
 void
 nsImapProtocol::UidExpunge(const nsCString &messageSet)
 {
     IncrementCommandTagNumber();
     nsCString command(GetServerCommandTag());
-    command.Append(" uid expunge ");
+    command.AppendLiteral(" uid expunge ");
     command.Append(messageSet);
     command.Append(CRLF);
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 void
@@ -5406,17 +5406,17 @@ nsImapProtocol::Expunge()
       delete search;
       if (key == 0)
         return;  //no deleted messages to expunge (bug 235004)
     }
   }
 
   IncrementCommandTagNumber();
   nsAutoCString command(GetServerCommandTag());
-  command.Append(" expunge" CRLF);
+  command.AppendLiteral(" expunge" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
     ParseIMAPandCheckForNewMail();
 }
 
 void
 nsImapProtocol::HandleMemoryFailure()
@@ -5441,31 +5441,31 @@ void nsImapProtocol::HandleCurrentUrlErr
   }
 }
 
 void nsImapProtocol::StartTLS()
 {
     IncrementCommandTagNumber();
     nsCString command(GetServerCommandTag());
 
-    command.Append(" STARTTLS" CRLF);
+    command.AppendLiteral(" STARTTLS" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::Capability()
 {
 
     ProgressEventFunctionUsingName("imapStatusCheckCompat");
     IncrementCommandTagNumber();
     nsCString command(GetServerCommandTag());
 
-    command.Append(" capability" CRLF);
+    command.AppendLiteral(" capability" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
     if (!gUseLiteralPlus)
     {
       eIMAPCapabilityFlags capabilityFlag = GetServerStateParser().GetCapabilityFlag();
       if (capabilityFlag & kLiteralPlusCapability)
@@ -5476,49 +5476,49 @@ void nsImapProtocol::Capability()
 }
 
 void nsImapProtocol::ID()
 {
   if (!gAppName[0])
     return;
   IncrementCommandTagNumber();
   nsCString command(GetServerCommandTag());
-  command.Append(" ID (\"name\" \"");
+  command.AppendLiteral(" ID (\"name\" \"");
   command.Append(gAppName);
-  command.Append("\" \"version\" \"");
+  command.AppendLiteral("\" \"version\" \"");
   command.Append(gAppVersion);
-  command.Append("\")" CRLF);
+  command.AppendLiteral("\")" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
     ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::EnableCondStore()
 {
   IncrementCommandTagNumber();
   nsCString command(GetServerCommandTag());
 
-  command.Append(" ENABLE CONDSTORE" CRLF);
+  command.AppendLiteral(" ENABLE CONDSTORE" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
     ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::StartCompressDeflate()
 {
   // only issue a compression request if we haven't already
   if (!TestFlag(IMAP_ISSUED_COMPRESS_REQUEST))
   {
     SetFlag(IMAP_ISSUED_COMPRESS_REQUEST);
     IncrementCommandTagNumber();
     nsCString command(GetServerCommandTag());
 
-    command.Append(" COMPRESS DEFLATE" CRLF);
+    command.AppendLiteral(" COMPRESS DEFLATE" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
     {
       ParseIMAPandCheckForNewMail();
       if (GetServerStateParser().LastCommandSuccessful())
       {
         rv = BeginCompressing();
@@ -5581,17 +5581,17 @@ void nsImapProtocol::Language()
       LossyCopyUTF16toASCII(mAcceptLanguages, extractedLanguage);
       int32_t pos = extractedLanguage.FindChar(',');
       if (pos > 0) // we have a comma separated list of languages...
         extractedLanguage.SetLength(pos); // truncate everything after the first comma (including the comma)
 
       if (extractedLanguage.IsEmpty())
         return;
 
-      command.Append(" LANGUAGE ");
+      command.AppendLiteral(" LANGUAGE ");
       command.Append(extractedLanguage);
       command.Append(CRLF);
 
       rv = SendData(command.get());
       if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail(nullptr, true /* ignore bad or no result from the server for this command */);
     }
   }
@@ -5753,34 +5753,34 @@ nsresult nsImapProtocol::AuthLogin(const
   nsresult rv;
   NS_ConvertUTF16toUTF8 password(aPassword);
   MOZ_LOG(IMAP, LogLevel::Debug, ("IMAP: trying auth method 0x%" PRIx64, m_currentAuthMethod));
 
   if (flag & kHasAuthExternalCapability)
   {
       char *base64UserName = PL_Base64Encode(userName, strlen(userName), nullptr);
       nsAutoCString command (GetServerCommandTag());
-      command.Append(" authenticate EXTERNAL " );
+      command.AppendLiteral(" authenticate EXTERNAL " );
       command.Append(base64UserName);
       command.Append(CRLF);
       PR_Free(base64UserName);
       rv = SendData(command.get());
       ParseIMAPandCheckForNewMail();
       nsImapServerResponseParser &parser = GetServerStateParser();
       if (parser.LastCommandSuccessful())
         return NS_OK;
       parser.SetCapabilityFlag(parser.GetCapabilityFlag() & ~kHasAuthExternalCapability);
   }
   else if (flag & kHasCRAMCapability)
   {
     NS_ENSURE_TRUE(m_imapServerSink, NS_ERROR_NULL_POINTER);
     MOZ_LOG(IMAP, LogLevel::Debug, ("MD5 auth"));
     // inform the server that we want to begin a CRAM authentication procedure...
     nsAutoCString command (GetServerCommandTag());
-    command.Append(" authenticate CRAM-MD5" CRLF);
+    command.AppendLiteral(" authenticate CRAM-MD5" CRLF);
     rv = SendData(command.get());
     NS_ENSURE_SUCCESS(rv, rv);
     ParseIMAPandCheckForNewMail();
     if (GetServerStateParser().LastCommandSuccessful())
     {
       char *digest = nullptr;
       char *cramDigest = GetServerStateParser().fAuthChallenge;
       char *decodedChallenge = PL_Base64Decode(cramDigest,
@@ -5821,17 +5821,17 @@ nsresult nsImapProtocol::AuthLogin(const
     nsAutoCString response;
 
     nsAutoCString service("imap@");
     service.Append(m_realHostName);
     rv = DoGSSAPIStep1(service.get(), userName, response);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsAutoCString command (GetServerCommandTag());
-    command.Append(" authenticate GSSAPI" CRLF);
+    command.AppendLiteral(" authenticate GSSAPI" CRLF);
     rv = SendData(command.get());
     NS_ENSURE_SUCCESS(rv, rv);
 
     ParseIMAPandCheckForNewMail("AUTH GSSAPI");
     if (GetServerStateParser().LastCommandSuccessful())
     {
       response += CRLF;
       rv = SendData(response.get());
@@ -5946,29 +5946,29 @@ nsresult nsImapProtocol::AuthLogin(const
   } // if has auth login capability
   else if (flag & kHasAuthOldLoginCapability)
   {
     MOZ_LOG(IMAP, LogLevel::Debug, ("old-style auth"));
     ProgressEventFunctionUsingName("imapStatusSendingLogin");
     IncrementCommandTagNumber();
     nsCString command (GetServerCommandTag());
     nsAutoCString escapedUserName;
-    command.Append(" login \"");
+    command.AppendLiteral(" login \"");
     EscapeUserNamePasswordString(userName, &escapedUserName);
     command.Append(escapedUserName);
-    command.Append("\" \"");
+    command.AppendLiteral("\" \"");
 
     // if the password contains a \, login will fail
     // turn foo\bar into foo\\bar
     nsAutoCString correctedPassword;
     // We're assuming old style login doesn't want UTF-8
     EscapeUserNamePasswordString(NS_LossyConvertUTF16toASCII(aPassword).get(),
                                  &correctedPassword);
     command.Append(correctedPassword);
-    command.Append("\"" CRLF);
+    command.AppendLiteral("\"" CRLF);
     rv = SendData(command.get(), true /* suppress logging */);
     NS_ENSURE_SUCCESS(rv, rv);
     ParseIMAPandCheckForNewMail();
   }
   else if (flag & kHasXOAuth2Capability)
   {
     MOZ_LOG(IMAP, LogLevel::Debug, ("XOAUTH2 auth"));
 
@@ -6102,36 +6102,36 @@ void nsImapProtocol::UploadMessageFromFi
   nsCString flagString;
   bool hasLiteralPlus = (GetServerStateParser().GetCapabilityFlag() &
     kLiteralPlusCapability);
 
   nsCOMPtr <nsIInputStream> fileInputStream;
 
   if (!escapedName.IsEmpty())
   {
-    command.Append(" append \"");
+    command.AppendLiteral(" append \"");
     command.Append(escapedName);
-    command.Append("\"");
+    command.Append('"');
     if (flags || keywords.Length())
     {
-      command.Append(" (");
+      command.AppendLiteral(" (");
 
       if (flags)
       {
         SetupMessageFlagsString(flagString, flags,
           GetServerStateParser().SupportsUserFlags());
         command.Append(flagString);
       }
       if (keywords.Length())
       {
         if (flags)
           command.Append(' ');
         command.Append(keywords);
       }
-      command.Append(")");
+      command.Append(')');
     }
 
     // date should never be 0, but just in case...
     if (date)
     {
       /* Use PR_FormatTimeUSEnglish() to format the date in US English format,
         then figure out what our local GMT offset is, and append it (since
         PR_FormatTimeUSEnglish() can't do that.) Generate four digit years as
@@ -6149,30 +6149,30 @@ void nsImapProtocol::UploadMessageFromFi
                             " \"%s %c%02d%02d\"",
                             szDateTime,
                             (gmtoffset >= 0 ? '+' : '-'),
                             ((gmtoffset >= 0 ? gmtoffset : -gmtoffset) / 60),
                             ((gmtoffset >= 0 ? gmtoffset : -gmtoffset) % 60));
 
       command.Append(dateStr);
     }
-    command.Append(" {");
+    command.AppendLiteral(" {");
 
     dataBuffer = (char*) PR_CALLOC(COPY_BUFFER_SIZE+1);
     if (!dataBuffer) goto done;
     rv = file->GetFileSize(&fileSize);
     NS_ASSERTION(fileSize, "got empty file in UploadMessageFromFile");
     if (NS_FAILED(rv) || !fileSize) goto done;
     rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream), file);
     if (NS_FAILED(rv) || !fileInputStream) goto done;
     command.AppendInt((int32_t)fileSize);
     if (hasLiteralPlus)
-      command.Append("+}" CRLF);
+      command.AppendLiteral("+}" CRLF);
     else
-      command.Append("}" CRLF);
+      command.AppendLiteral("}" CRLF);
 
     rv = SendData(command.get());
     if (NS_FAILED(rv)) goto done;
 
     if (!hasLiteralPlus)
       ParseIMAPandCheckForNewMail();
 
     totalSize = fileSize;
@@ -6500,19 +6500,19 @@ void nsImapProtocol::RefreshFolderACLVie
 
 void nsImapProtocol::GetACLForFolder(const char *mailboxName)
 {
   IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
   nsCString escapedName;
   CreateEscapedMailboxName(mailboxName, escapedName);
-  command.Append(" getacl \"");
+  command.AppendLiteral(" getacl \"");
   command.Append(escapedName);
-  command.Append("\"" CRLF);
+  command.AppendLiteral("\"" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
     ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::OnRefreshAllACLs()
 {
@@ -6566,105 +6566,105 @@ void nsImapProtocol::Logout(bool shuttin
     if (closeNeeded && GetDeleteIsMoveToTrash())
         Close();
 ********************/
 
   IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
 
-  command.Append(" logout" CRLF);
+  command.AppendLiteral(" logout" CRLF);
 
   nsresult rv = SendData(command.get());
   if (m_transport && shuttingDown)
     m_transport->SetTimeout(nsISocketTransport::TIMEOUT_READ_WRITE, 5);
   // the socket may be dead before we read the response, so drop it.
   if (NS_SUCCEEDED(rv) && waitForResponse)
       ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::Noop()
 {
   //ProgressUpdateEvent("noop...");
   IncrementCommandTagNumber();
   nsCString command(GetServerCommandTag());
 
-  command.Append(" noop" CRLF);
+  command.AppendLiteral(" noop" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
       ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::XServerInfo()
 {
 
     ProgressEventFunctionUsingName("imapGettingServerInfo");
     IncrementCommandTagNumber();
     nsCString command(GetServerCommandTag());
 
-  command.Append(" XSERVERINFO MANAGEACCOUNTURL MANAGELISTSURL MANAGEFILTERSURL" CRLF);
+  command.AppendLiteral(" XSERVERINFO MANAGEACCOUNTURL MANAGELISTSURL MANAGEFILTERSURL" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::Netscape()
 {
     ProgressEventFunctionUsingName("imapGettingServerInfo");
     IncrementCommandTagNumber();
 
     nsCString command(GetServerCommandTag());
 
-  command.Append(" netscape" CRLF);
+  command.AppendLiteral(" netscape" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 
 
 void nsImapProtocol::XMailboxInfo(const char *mailboxName)
 {
 
     ProgressEventFunctionUsingName("imapGettingMailboxInfo");
     IncrementCommandTagNumber();
     nsCString command(GetServerCommandTag());
 
-  command.Append(" XMAILBOXINFO \"");
+  command.AppendLiteral(" XMAILBOXINFO \"");
   command.Append(mailboxName);
-  command.Append("\" MANAGEURL POSTURL" CRLF);
+  command.AppendLiteral("\" MANAGEURL POSTURL" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::Namespace()
 {
 
     IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
-  command.Append(" namespace" CRLF);
+  command.AppendLiteral(" namespace" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 
 void nsImapProtocol::MailboxData()
 {
     IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
-  command.Append(" mailboxdata" CRLF);
+  command.AppendLiteral(" mailboxdata" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
         ParseIMAPandCheckForNewMail();
 }
 
 
 void nsImapProtocol::GetMyRightsForFolder(const char *mailboxName)
@@ -6673,19 +6673,19 @@ void nsImapProtocol::GetMyRightsForFolde
 
   nsCString command(GetServerCommandTag());
   nsCString escapedName;
   CreateEscapedMailboxName(mailboxName, escapedName);
 
   if (MailboxIsNoSelectMailbox(escapedName.get()))
     return; // Don't issue myrights on Noselect folder
 
-  command.Append(" myrights \"");
+  command.AppendLiteral(" myrights \"");
   command.Append(escapedName);
-  command.Append("\"" CRLF);
+  command.AppendLiteral("\"" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
     ParseIMAPandCheckForNewMail();
 }
 
 bool nsImapProtocol::FolderIsSelected(const char *mailboxName)
 {
@@ -6710,19 +6710,19 @@ void nsImapProtocol::OnStatusForFolder(c
   }
 
   IncrementCommandTagNumber();
 
   nsAutoCString command(GetServerCommandTag());
   nsCString escapedName;
   CreateEscapedMailboxName(mailboxName, escapedName);
 
-  command.Append(" STATUS \"");
+  command.AppendLiteral(" STATUS \"");
   command.Append(escapedName);
-  command.Append("\" (UIDNEXT MESSAGES UNSEEN RECENT)" CRLF);
+  command.AppendLiteral("\" (UIDNEXT MESSAGES UNSEEN RECENT)" CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
       ParseIMAPandCheckForNewMail();
 
   if (GetServerStateParser().LastCommandSuccessful())
   {
     RefPtr<nsImapMailboxSpec> new_spec = GetServerStateParser().CreateCurrentMailboxSpec(mailboxName);
@@ -7424,22 +7424,22 @@ void nsImapProtocol::DiscoverMailboxList
         }
 
         // now do the folders within this namespace
         nsCString pattern;
         nsCString pattern2;
         if (usingSubscription)
         {
           pattern.Append(prefix);
-          pattern.Append("*");
+          pattern.Append('*');
         }
         else
         {
           pattern.Append(prefix);
-          pattern.Append("%"); // mscott just need one percent right?
+          pattern.Append('%'); // mscott just need one percent right?
           // pattern = PR_smprintf("%s%%", prefix);
           char delimiter = ns->GetDelimiter();
           if (delimiter)
           {
             // delimiter might be NIL, in which case there's no hierarchy anyway
             pattern2 = prefix;
             pattern2 += "%";
             pattern2 += delimiter;
@@ -7933,18 +7933,18 @@ void nsImapProtocol::Search(const char *
 {
   m_notifySearchHit = notifyHit;
   ProgressEventFunctionUsingName("imapStatusSearchMailbox");
   IncrementCommandTagNumber();
 
   nsCString protocolString(GetServerCommandTag());
   // the searchCriteria string contains the 'search ....' string
   if (useUID)
-     protocolString.Append(" uid");
-  protocolString.Append(" ");
+     protocolString.AppendLiteral(" uid");
+  protocolString.Append(' ');
   protocolString.Append(searchCriteria);
   // the search criteria can contain string literals, which means we
   // need to break up the protocol string by CRLF's, and after sending CRLF,
   // wait for the server to respond OK before sending more data
   nsresult rv;
   int32_t crlfIndex;
   while ((crlfIndex = protocolString.Find(CRLF)) != kNotFound && !DeathSignalReceived())
   {
@@ -7993,32 +7993,32 @@ void nsImapProtocol::Copy(const char * m
       idString.Assign(messageList);
 
     msgsHandled += msgsToHandle;
     msgCountLeft -= msgsToHandle;
 
     IncrementCommandTagNumber();
     nsAutoCString protocolString(GetServerCommandTag());
     if (idsAreUid)
-      protocolString.Append(" uid");
+      protocolString.AppendLiteral(" uid");
     // If it's a MOVE operation on aol servers then use 'xaol-move' cmd.
     if ((m_imapAction == nsIImapUrl::nsImapOnlineMove) &&
         GetServerStateParser().ServerIsAOLServer())
-      protocolString.Append(" xaol-move ");
+      protocolString.AppendLiteral(" xaol-move ");
     else if ((m_imapAction == nsIImapUrl::nsImapOnlineMove) &&
              GetServerStateParser().GetCapabilityFlag() & kHasMoveCapability)
-      protocolString.Append(" move ");
+      protocolString.AppendLiteral(" move ");
     else
-      protocolString.Append(" copy ");
+      protocolString.AppendLiteral(" copy ");
 
 
     protocolString.Append(idString);
-    protocolString.Append(" \"");
+    protocolString.AppendLiteral(" \"");
     protocolString.Append(escapedDestination);
-    protocolString.Append("\"" CRLF);
+    protocolString.AppendLiteral("\"" CRLF);
 
     nsresult rv = SendData(protocolString.get());
     if (NS_SUCCEEDED(rv))
        ParseIMAPandCheckForNewMail(protocolString.get());
   }
   while (msgCountLeft > 0 && !DeathSignalReceived());
 }
 
@@ -8235,22 +8235,22 @@ void nsImapProtocol::ProcessAfterAuthent
         nsAutoCString statusString;
         m_forceSelect = IsExtraSelectNeeded();
         // Setting to "yes-auto" or "no-auto" avoids doing redundant calls to
         // IsExtraSelectNeeded() on subsequent ID() occurrences. It also
         // provides feedback to the user regarding the detection status.
         if (m_forceSelect)
         {
           // Set preference value to "yes-auto".
-          statusString.Assign("yes-auto");
+          statusString.AssignLiteral("yes-auto");
         }
         else
         {
           // Set preference value to "no-auto".
-          statusString.Assign("no-auto");
+          statusString.AssignLiteral("no-auto");
         }
         m_imapServerSink->SetServerForceSelect(statusString);
         break;
       }
     }
   }
 
   // If no ID capability or empty ID response, user may still want to
@@ -8259,17 +8259,17 @@ void nsImapProtocol::ProcessAfterAuthent
   {
     switch (m_forceSelectValue.get()[0])
     {
     case 'a':
       {
         // If default "auto", set to "no-auto" so visible in config editor
         // and set/keep m_forceSelect false.
         nsAutoCString statusString;
-        statusString.Assign("no-auto");
+        statusString.AssignLiteral("no-auto");
         m_imapServerSink->SetServerForceSelect(statusString);
         m_forceSelect = false;
       }
       break;
     case 'y':
     case 'Y':
       m_forceSelect = true;
       break;
@@ -8279,33 +8279,33 @@ void nsImapProtocol::ProcessAfterAuthent
   }
 }
 
 void nsImapProtocol::SetupMessageFlagsString(nsCString& flagString,
                                              imapMessageFlagsType flags,
                                              uint16_t userFlags)
 {
     if (flags & kImapMsgSeenFlag)
-        flagString.Append("\\Seen ");
+        flagString.AppendLiteral("\\Seen ");
     if (flags & kImapMsgAnsweredFlag)
-        flagString.Append("\\Answered ");
+        flagString.AppendLiteral("\\Answered ");
     if (flags & kImapMsgFlaggedFlag)
-        flagString.Append("\\Flagged ");
+        flagString.AppendLiteral("\\Flagged ");
     if (flags & kImapMsgDeletedFlag)
-        flagString.Append("\\Deleted ");
+        flagString.AppendLiteral("\\Deleted ");
     if (flags & kImapMsgDraftFlag)
-        flagString.Append("\\Draft ");
+        flagString.AppendLiteral("\\Draft ");
     if (flags & kImapMsgRecentFlag)
-        flagString.Append("\\Recent ");
+        flagString.AppendLiteral("\\Recent ");
     if ((flags & kImapMsgForwardedFlag) &&
         (userFlags & kImapMsgSupportForwardedFlag))
-        flagString.Append("$Forwarded "); // Not always available
+        flagString.AppendLiteral("$Forwarded "); // Not always available
     if ((flags & kImapMsgMDNSentFlag) && (
         userFlags & kImapMsgSupportMDNSentFlag))
-        flagString.Append("$MDNSent "); // Not always available
+        flagString.AppendLiteral("$MDNSent "); // Not always available
 
     // eat the last space
     if (!flagString.IsEmpty())
         flagString.SetLength(flagString.Length()-1);
 }
 
 void nsImapProtocol::ProcessStoreFlags(const nsCString &messageIdsString,
                                                  bool idsAreUids,
@@ -8325,29 +8325,29 @@ void nsImapProtocol::ProcessStoreFlags(c
   }
 
   if (addFlags)
       flagString = "+Flags (";
   else
       flagString = "-Flags (";
 
   if (flags & kImapMsgSeenFlag && kImapMsgSeenFlag & settableFlags)
-      flagString .Append("\\Seen ");
+      flagString .AppendLiteral("\\Seen ");
   if (flags & kImapMsgAnsweredFlag && kImapMsgAnsweredFlag & settableFlags)
-      flagString .Append("\\Answered ");
+      flagString .AppendLiteral("\\Answered ");
   if (flags & kImapMsgFlaggedFlag && kImapMsgFlaggedFlag & settableFlags)
-      flagString .Append("\\Flagged ");
+      flagString .AppendLiteral("\\Flagged ");
   if (flags & kImapMsgDeletedFlag && kImapMsgDeletedFlag & settableFlags)
-      flagString .Append("\\Deleted ");
+      flagString .AppendLiteral("\\Deleted ");
   if (flags & kImapMsgDraftFlag && kImapMsgDraftFlag & settableFlags)
-      flagString .Append("\\Draft ");
+      flagString .AppendLiteral("\\Draft ");
   if (flags & kImapMsgForwardedFlag && kImapMsgSupportForwardedFlag & userFlags)
-        flagString .Append("$Forwarded ");  // if supported
+        flagString .AppendLiteral("$Forwarded ");  // if supported
   if (flags & kImapMsgMDNSentFlag && kImapMsgSupportMDNSentFlag & userFlags)
-        flagString .Append("$MDNSent ");  // if supported
+        flagString .AppendLiteral("$MDNSent ");  // if supported
 
   if (flagString.Length() > 8) // if more than "+Flags ("
   {
   // replace the final space with ')'
     flagString.SetCharAt(')',flagString.Length() - 1);
 
     Store(messageIdsString, flagString.get(), idsAreUids);
     if (m_runningUrl && idsAreUids)
@@ -8379,17 +8379,17 @@ void nsImapProtocol::ProcessStoreFlags(c
 
 
 void nsImapProtocol::Close(bool shuttingDown /* = false */,
                            bool waitForResponse /* = true */)
 {
   IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
-  command.Append(" close" CRLF);
+  command.AppendLiteral(" close" CRLF);
 
   if (!shuttingDown)
     ProgressEventFunctionUsingName("imapStatusCloseMailbox");
 
   GetServerStateParser().ResetFlagInfo();
 
   nsresult rv = SendData(command.get());
   if (m_transport && shuttingDown)
@@ -8399,33 +8399,33 @@ void nsImapProtocol::Close(bool shutting
       ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::XAOL_Option(const char *option)
 {
   IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
-  command.Append(" XAOL-OPTION ");
+  command.AppendLiteral(" XAOL-OPTION ");
   command.Append(option);
   command.Append(CRLF);
 
   nsresult rv = SendData(command.get());
   if (NS_SUCCEEDED(rv))
       ParseIMAPandCheckForNewMail();
 }
 
 void nsImapProtocol::Check()
 {
     //ProgressUpdateEvent("Checking mailbox...");
 
     IncrementCommandTagNumber();
 
   nsCString command(GetServerCommandTag());
-  command.Append(" check" CRLF);
+  command.AppendLiteral(" check" CRLF);
 
     nsresult rv = SendData(command.get());
     if (NS_SUCCEEDED(rv))
     {
         m_flagChangeCount = 0;
         m_lastCheckTime = PR_Now();
         ParseIMAPandCheckForNewMail();
     }
--- a/mailnews/imap/src/nsImapServerResponseParser.cpp
+++ b/mailnews/imap/src/nsImapServerResponseParser.cpp
@@ -674,17 +674,17 @@ void nsImapServerResponseParser::respons
         fServerConnection.GetCurrentUrl()->GetCommand(customCommand);
         if (customCommand.Equals(fNextToken))
         {
           nsAutoCString customCommandResponse;
           while (Connected() && !fAtEndOfLine)
           {
             AdvanceToNextToken();
             customCommandResponse.Append(fNextToken);
-            customCommandResponse.Append(" ");
+            customCommandResponse.Append(' ');
           }
           fServerConnection.GetCurrentUrl()->SetCustomCommandResult(customCommandResponse);
         }
         else
           SetSyntaxError(true);
       }
       break;
     case 'Q':
@@ -1524,25 +1524,25 @@ void nsImapServerResponseParser::xaolenv
       AdvanceToNextToken();
       if (ContinueParse())
       {
         nsAutoCString fromLine;
         if (!strcmp(GetSelectedMailboxName(), "Sent Items"))
         {
           // xaol envelope switches the From with the To, so we switch them back and
           // create a fake from line From: user@aol.com
-          fromLine.Append("To: ");
+          fromLine.AppendLiteral("To: ");
           nsAutoCString fakeFromLine(NS_LITERAL_CSTRING("From: "));
           fakeFromLine.Append(fServerConnection.GetImapUserName());
           fakeFromLine.Append(NS_LITERAL_CSTRING("@aol.com"));
           fServerConnection.HandleMessageDownLoadLine(fakeFromLine.get(), false);
         }
         else
         {
-          fromLine.Append("From: ");
+          fromLine.AppendLiteral("From: ");
         }
         parse_address(fromLine);
         fServerConnection.HandleMessageDownLoadLine(fromLine.get(), false);
         if (ContinueParse())
         {
           AdvanceToNextToken();	// ge attachment size
           int32_t attachmentSize = atoi(fNextToken);
           if (attachmentSize != 0)
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -208,17 +208,17 @@ NS_IMETHODIMP nsImapService::SelectFolde
     mailNewsUrl->SetMsgWindow(aMsgWindow);
     mailNewsUrl->SetUpdatingFolder(true);
     rv = SetImapUrlSink(aImapMailFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsAutoCString folderName;
       GetFolderName(aImapMailFolder, folderName);
-      urlSpec.Append("/select>");
+      urlSpec.AppendLiteral("/select>");
       urlSpec.Append(hierarchyDelimiter);
       urlSpec.Append(folderName);
       rv = mailNewsUrl->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   } // if we have a url to run....
 
@@ -261,23 +261,23 @@ NS_IMETHODIMP nsImapService::GetUrlForUr
     nsCOMPtr <nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(imapUrl);
     bool useLocalCache = false;
     folder->HasMsgOffline(strtoul(msgKey.get(), nullptr, 10), &useLocalCache);
     mailnewsUrl->SetMsgIsInLocalCache(useLocalCache);
 
     nsCOMPtr<nsIURI> url = do_QueryInterface(imapUrl);
     rv = url->GetSpec(urlSpec);
     NS_ENSURE_SUCCESS(rv, rv);
-    urlSpec.Append("fetch>UID>");
+    urlSpec.AppendLiteral("fetch>UID>");
     urlSpec.Append(hierarchyDelimiter);
 
     nsAutoCString folderName;
     GetFolderName(folder, folderName);
     urlSpec.Append(folderName);
-    urlSpec.Append(">");
+    urlSpec.Append('>');
     urlSpec.Append(msgKey);
     rv = url->SetSpec(urlSpec);
     imapUrl->QueryInterface(NS_GET_IID(nsIURI), (void **) aURL);
   }
 
   return rv;
 }
 
@@ -338,23 +338,23 @@ NS_IMETHODIMP nsImapService::OpenAttachm
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIImapUrl> imapUrl;
       nsAutoCString urlSpec;
       char hierarchyDelimiter = GetHierarchyDelimiter(folder);
       rv = CreateStartOfImapUrl(uri, getter_AddRefs(imapUrl), folder, aUrlListener, urlSpec, hierarchyDelimiter);
       NS_ENSURE_SUCCESS(rv, rv);
 
-      urlSpec.Append("/fetch>UID>");
+      urlSpec.AppendLiteral("/fetch>UID>");
       urlSpec.Append(hierarchyDelimiter);
 
       nsCString folderName;
       GetFolderName(folder, folderName);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(msgKey);
       urlSpec.Append(uriMimePart);
 
       if (!uriMimePart.IsEmpty())
       {
         nsCOMPtr<nsIMsgMailNewsUrl> mailUrl (do_QueryInterface(imapUrl));
         if (mailUrl)
         {
@@ -596,17 +596,17 @@ nsresult nsImapService::FetchMimePart(ns
 
     rv = url->GetSpec(urlSpec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // rhp: If we are displaying this message for the purpose of printing, we
     // need to append the header=print option.
     //
     if (mPrintingOperation)
-      urlSpec.Append("?header=print");
+      urlSpec.AppendLiteral("?header=print");
 
     rv = url->SetSpec(urlSpec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = aImapUrl->SetImapAction(actionToUse /* nsIImapUrl::nsImapMsgFetch */);
     if (aImapMailFolder && aDisplayConsumer)
     {
       nsCOMPtr<nsIMsgIncomingServer> aMsgIncomingServer;
@@ -825,17 +825,17 @@ NS_IMETHODIMP nsImapService::Search(nsIM
   {
     nsCString folderName;
     GetFolderName(aMsgFolder, folderName);
 
     nsCOMPtr <nsIMsgMailNewsUrl> mailNewsUrl = do_QueryInterface(imapUrl);
     if (!aMsgWindow)
       mailNewsUrl->SetSuppressErrorMsgs(true);
 
-    urlSpec.Append("/search>UID>");
+    urlSpec.AppendLiteral("/search>UID>");
     urlSpec.Append(hierarchyDelimiter);
     urlSpec.Append(folderName);
     urlSpec.Append('>');
     // escape aSearchUri so that IMAP special characters (i.e. '\')
     // won't be replaced with '/' in NECKO.
     // it will be unescaped in nsImapUrl::ParseUrl().
     nsCString escapedSearchUri;
 
@@ -955,29 +955,29 @@ NS_IMETHODIMP nsImapService::AddImapFetc
   NS_ENSURE_ARG_POINTER(aUrl);
 
   nsAutoCString urlSpec;
   nsresult rv = aUrl->GetSpec(urlSpec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   char hierarchyDelimiter = GetHierarchyDelimiter(aImapMailFolder);
 
-  urlSpec.Append("fetch>UID>");
+  urlSpec.AppendLiteral("fetch>UID>");
   urlSpec.Append(hierarchyDelimiter);
 
   nsAutoCString folderName;
   GetFolderName(aImapMailFolder, folderName);
   urlSpec.Append(folderName);
 
-  urlSpec.Append(">");
+  urlSpec.Append('>');
   urlSpec.Append(aMessageIdentifierList);
 
   if (!aAdditionalHeader.IsEmpty())
   {
-    urlSpec.Append("?header=");
+    urlSpec.AppendLiteral("?header=");
     urlSpec.Append(aAdditionalHeader);
   }
 
   return aUrl->SetSpec(urlSpec);
 }
 
 NS_IMETHODIMP nsImapService::FetchMessage(nsIImapUrl *aImapUrl,
                                           nsImapAction aImapAction,
@@ -1401,26 +1401,26 @@ NS_IMETHODIMP nsImapService::GetHeaders(
   {
     nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
     rv = imapUrl->SetImapAction(nsIImapUrl::nsImapMsgFetch);
     rv = SetImapUrlSink(aImapMailFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
-      urlSpec.Append("/header>");
+      urlSpec.AppendLiteral("/header>");
       urlSpec.Append(messageIdsAreUID ? uidString : sequenceString);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(char (hierarchyDelimiter));
 
       nsCString folderName;
 
       GetFolderName(aImapMailFolder, folderName);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(messageIdentifierList);
       rv = uri->SetSpec(urlSpec);
 
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   }
   return rv;
@@ -1451,27 +1451,27 @@ NS_IMETHODIMP nsImapService::GetBodyStar
   {
     rv = imapUrl->SetImapAction(nsIImapUrl::nsImapMsgPreview);
     rv = SetImapUrlSink(aImapMailFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
-      urlSpec.Append("/previewBody>");
+      urlSpec.AppendLiteral("/previewBody>");
       urlSpec.Append(uidString);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(hierarchyDelimiter);
 
       nsCString folderName;
       GetFolderName(aImapMailFolder, folderName);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(messageIdentifierList);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.AppendInt(numBytes);
       rv = uri->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   }
   return rv;
 }
@@ -1529,17 +1529,17 @@ nsImapService::VerifyLogon(nsIMsgFolder 
   if (NS_SUCCEEDED(rv) && imapUrl)
   {
     nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
     nsCOMPtr<nsIMsgMailNewsUrl> mailNewsUrl = do_QueryInterface(imapUrl);
     mailNewsUrl->SetSuppressErrorMsgs(true);
     mailNewsUrl->SetMsgWindow(aMsgWindow);
     rv = SetImapUrlSink(aFolder, imapUrl);
-    urlSpec.Append("/verifyLogon");
+    urlSpec.AppendLiteral("/verifyLogon");
     rv = uri->SetSpec(urlSpec);
     if (NS_SUCCEEDED(rv))
       rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, nullptr);
     if (aURL)
       uri.forget(aURL);
   }
   return rv;
 }
@@ -1596,23 +1596,23 @@ NS_IMETHODIMP nsImapService::Biff(nsIMsg
   if (NS_SUCCEEDED(rv) && imapUrl)
   {
     rv = imapUrl->SetImapAction(nsIImapUrl::nsImapExpungeFolder);
     rv = SetImapUrlSink(aImapMailFolder, imapUrl);
 
     nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
     if (NS_SUCCEEDED(rv))
     {
-      urlSpec.Append("/Biff>");
+      urlSpec.AppendLiteral("/Biff>");
       urlSpec.Append(hierarchyDelimiter);
 
       nsCString folderName;
       GetFolderName(aImapMailFolder, folderName);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.AppendInt(uidHighWater);
       rv = uri->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   }
   return rv;
 }
@@ -1662,25 +1662,25 @@ NS_IMETHODIMP nsImapService::DeleteMessa
   {
     rv = imapUrl->SetImapAction(nsIImapUrl::nsImapMsgFetch);
     rv = SetImapUrlSink(aImapMailFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
-      urlSpec.Append("/deletemsg>");
+      urlSpec.AppendLiteral("/deletemsg>");
       urlSpec.Append(messageIdsAreUID ? uidString : sequenceString);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(hierarchyDelimiter);
 
       nsCString folderName;
       GetFolderName(aImapMailFolder, folderName);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(messageIdentifierList);
       rv = uri->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   }
   return rv;
 }
@@ -1763,22 +1763,22 @@ nsresult nsImapService::DiddleFlags(nsIM
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
       urlSpec.Append('/');
       urlSpec.Append(howToDiddle);
       urlSpec.Append('>');
       urlSpec.Append(messageIdsAreUID ? uidString : sequenceString);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(hierarchyDelimiter);
       nsCString folderName;
       GetFolderName(aImapMailFolder, folderName);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(messageIdentifierList);
       urlSpec.Append('>');
       urlSpec.AppendInt(flags);
       rv = uri->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   }
@@ -1834,17 +1834,17 @@ NS_IMETHODIMP nsImapService::DiscoverAll
     rv = SetImapUrlSink(aImapMailFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
       nsCOMPtr<nsIMsgMailNewsUrl> mailnewsurl = do_QueryInterface(imapUrl);
       if (mailnewsurl)
         mailnewsurl->SetMsgWindow(aMsgWindow);
-      urlSpec.Append("/discoverallboxes");
+      urlSpec.AppendLiteral("/discoverallboxes");
       nsCOMPtr <nsIURI> url = do_QueryInterface(imapUrl, &rv);
       rv = uri->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   }
   return rv;
 }
@@ -1862,17 +1862,17 @@ NS_IMETHODIMP nsImapService::DiscoverAll
   nsresult rv = CreateStartOfImapUrl(EmptyCString(), getter_AddRefs(aImapUrl), aImapMailFolder,
                                      aUrlListener, urlSpec, hierarchyDelimiter);
   if (NS_SUCCEEDED(rv) && aImapUrl)
   {
     rv = SetImapUrlSink(aImapMailFolder, aImapUrl);
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(aImapUrl);
-      urlSpec.Append("/discoverallandsubscribedboxes");
+      urlSpec.AppendLiteral("/discoverallandsubscribedboxes");
       rv = uri->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(aImapUrl, nullptr, aURL);
     }
   }
   return rv;
 }
 
@@ -1892,17 +1892,17 @@ NS_IMETHODIMP nsImapService::DiscoverChi
   if (NS_SUCCEEDED (rv))
   {
     rv = SetImapUrlSink(aImapMailFolder, aImapUrl);
     if (NS_SUCCEEDED(rv))
     {
       if (!folderPath.IsEmpty())
       {
         nsCOMPtr<nsIURI> uri = do_QueryInterface(aImapUrl);
-        urlSpec.Append("/discoverchildren>");
+        urlSpec.AppendLiteral("/discoverchildren>");
         urlSpec.Append(hierarchyDelimiter);
         urlSpec.Append(folderPath);
         rv = uri->SetSpec(urlSpec);
 
         // Make sure the uri has the same hierarchy separator as the one in msg folder 
         // obj if it's not kOnlineHierarchySeparatorUnknown (ie, '^').
         char uriDelimiter;
         nsresult rv1 = aImapUrl->GetOnlineSubDirSeparator(&uriDelimiter);
@@ -1965,19 +1965,19 @@ NS_IMETHODIMP nsImapService::OnlineMessa
     imapUrl->SetCopyState(copyState);
 
     nsCOMPtr<nsIMsgMailNewsUrl> msgurl (do_QueryInterface(imapUrl));
 
     msgurl->SetMsgWindow(aMsgWindow);
     nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
     if (isMove)
-      urlSpec.Append("/onlinemove>");
+      urlSpec.AppendLiteral("/onlinemove>");
     else
-      urlSpec.Append("/onlinecopy>");
+      urlSpec.AppendLiteral("/onlinecopy>");
     if (idsAreUids)
       urlSpec.Append(uidString);
     else
       urlSpec.Append(sequenceString);
     urlSpec.Append('>');
     urlSpec.Append(hierarchyDelimiter);
 
     nsCString folderName;
@@ -2154,19 +2154,19 @@ NS_IMETHODIMP nsImapService::AppendMessa
 
     SetImapUrlSink(aDstFolder, imapUrl);
     imapUrl->SetMsgFile(aFile);
     imapUrl->SetCopyState(aCopyState);
 
     nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
     if (inSelectedState)
-      urlSpec.Append("/appenddraftfromfile>");
+      urlSpec.AppendLiteral("/appenddraftfromfile>");
     else
-      urlSpec.Append("/appendmsgfromfile>");
+      urlSpec.AppendLiteral("/appendmsgfromfile>");
 
     urlSpec.Append(hierarchyDelimiter);
 
     nsCString folderName;
     GetFolderName(aDstFolder, folderName);
     urlSpec.Append(folderName);
 
     if (inSelectedState)
@@ -2259,17 +2259,17 @@ NS_IMETHODIMP nsImapService::MoveFolder(
       nsCOMPtr<nsIMsgMailNewsUrl> mailNewsUrl = do_QueryInterface(imapUrl);
       if (mailNewsUrl)
         mailNewsUrl->SetMsgWindow(msgWindow);
       char hierarchyDelimiter = kOnlineHierarchySeparatorUnknown;
       nsCString folderName;
 
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
       GetFolderName(srcFolder, folderName);
-      urlSpec.Append("/movefolderhierarchy>");
+      urlSpec.AppendLiteral("/movefolderhierarchy>");
       urlSpec.Append(hierarchyDelimiter);
       urlSpec.Append(folderName);
       urlSpec.Append('>');
       GetFolderName(dstFolder, folderName);
       if (!folderName.IsEmpty())
       {
         urlSpec.Append(hierarchyDelimiter);
         urlSpec.Append(folderName);
@@ -2305,17 +2305,17 @@ NS_IMETHODIMP nsImapService::RenameLeaf(
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
       nsCOMPtr<nsIMsgMailNewsUrl> mailNewsUrl = do_QueryInterface(imapUrl);
       if (mailNewsUrl)
         mailNewsUrl->SetMsgWindow(msgWindow);
       nsCString folderName;
       GetFolderName(srcFolder, folderName);
-      urlSpec.Append("/rename>");
+      urlSpec.AppendLiteral("/rename>");
       urlSpec.Append(hierarchyDelimiter);
       urlSpec.Append(folderName);
       urlSpec.Append('>');
       urlSpec.Append(hierarchyDelimiter);
       nsAutoCString cStrFolderName;
       // Unescape the name before looking for parent path
       MsgUnescapeString(folderName, 0, cStrFolderName);
       int32_t leafNameStart = cStrFolderName.RFindChar(hierarchyDelimiter);
@@ -2360,17 +2360,17 @@ NS_IMETHODIMP nsImapService::CreateFolde
   {
     rv = SetImapUrlSink(parent, imapUrl);
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
       nsCString folderName;
       GetFolderName(parent, folderName);
-      urlSpec.Append("/create>");
+      urlSpec.AppendLiteral("/create>");
       urlSpec.Append(hierarchyDelimiter);
       if (!folderName.IsEmpty())
       {
         nsCString canonicalName;
         nsImapUrl::ConvertToCanonicalFormat(folderName.get(),
                                             hierarchyDelimiter,
                                             getter_Copies(canonicalName));
         urlSpec.Append(canonicalName);
@@ -2409,17 +2409,17 @@ NS_IMETHODIMP nsImapService::EnsureFolde
   {
     rv = SetImapUrlSink(parent, imapUrl);
     if (NS_SUCCEEDED(rv))
     {
       nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
 
       nsCString folderName;
       GetFolderName(parent, folderName);
-      urlSpec.Append("/ensureExists>");
+      urlSpec.AppendLiteral("/ensureExists>");
       urlSpec.Append(hierarchyDelimiter);
       if (!folderName.IsEmpty())
       {
         urlSpec.Append(folderName);
         urlSpec.Append(hierarchyDelimiter);
       }
       nsAutoCString utfNewName; 
       CopyUTF16toMUTF7(PromiseFlatString(newFolderName), utfNewName);
@@ -2442,17 +2442,17 @@ NS_IMETHODIMP nsImapService::ListFolder(
   NS_ENSURE_ARG_POINTER(aImapMailFolder);
 
   return FolderCommand(aImapMailFolder, aUrlListener,
                        "/listfolder>", nsIImapUrl::nsImapListFolder, nullptr, aURL);
 }
 
 NS_IMETHODIMP nsImapService::GetScheme(nsACString &aScheme)
 {
-  aScheme.Assign("imap");
+  aScheme.AssignLiteral("imap");
   return NS_OK; 
 }
 
 NS_IMETHODIMP nsImapService::GetDefaultPort(int32_t *aDefaultPort)
 {
   NS_ENSURE_ARG_POINTER(aDefaultPort);
   *aDefaultPort = nsIImapUrl::DEFAULT_IMAP_PORT;
   return NS_OK;
@@ -3005,17 +3005,17 @@ NS_IMETHODIMP nsImapService::GetListOfFo
       tokenStr = StringHead(tempFolderName, slashPos);
       remStr = Substring(tempFolderName, slashPos);
     }
     else
       tokenStr.Assign(tempFolderName);
 
     if (tokenStr.LowerCaseEqualsLiteral("inbox") &&
         !tokenStr.EqualsLiteral("INBOX"))
-      changedStr.Append("INBOX");
+      changedStr.AppendLiteral("INBOX");
     else
       changedStr.Append(tokenStr);
 
     if (slashPos > 0 ) 
       changedStr.Append(remStr);
 
     rv = rootMsgFolder->FindSubFolder(changedStr, getter_AddRefs(msgFolder));
   }
@@ -3135,24 +3135,24 @@ NS_IMETHODIMP nsImapService::IssueComman
     mailNewsUrl->SetMsgWindow(aMsgWindow);
     mailNewsUrl->SetUpdatingFolder(true);
     rv = SetImapUrlSink(anImapFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsCString folderName;
       GetFolderName(anImapFolder, folderName);
-      urlSpec.Append("/");
+      urlSpec.Append('/');
       urlSpec.Append(aCommand);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(uidString);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(hierarchyDelimiter);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(uids);
       rv = mailNewsUrl->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   } // if we have a url to run....
 
   return rv;
@@ -3182,22 +3182,22 @@ NS_IMETHODIMP nsImapService::FetchCustom
     mailNewsUrl->SetMsgWindow(aMsgWindow);
     mailNewsUrl->SetUpdatingFolder(true);
     rv = SetImapUrlSink(anImapFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsCString folderName;
       GetFolderName(anImapFolder, folderName);
-      urlSpec.Append("/customFetch>UID>");
+      urlSpec.AppendLiteral("/customFetch>UID>");
       urlSpec.Append(hierarchyDelimiter);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(uids);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(aAttribute);
       rv = mailNewsUrl->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   } // if we have a url to run....
 
   return rv;
@@ -3227,24 +3227,24 @@ NS_IMETHODIMP nsImapService::StoreCustom
     mailNewsUrl->SetMsgWindow(aMsgWindow);
     mailNewsUrl->SetUpdatingFolder(true);
     rv = SetImapUrlSink(anImapFolder, imapUrl);
 
     if (NS_SUCCEEDED(rv))
     {
       nsCString folderName;
       GetFolderName(anImapFolder, folderName);
-      urlSpec.Append("/customKeywords>UID>");
+      urlSpec.AppendLiteral("/customKeywords>UID>");
       urlSpec.Append(hierarchyDelimiter);
       urlSpec.Append(folderName);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(uids);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(flagsToAdd);
-      urlSpec.Append(">");
+      urlSpec.Append('>');
       urlSpec.Append(flagsToSubtract);
       rv = mailNewsUrl->SetSpec(urlSpec);
       if (NS_SUCCEEDED(rv))
         rv = GetImapConnectionAndLoadUrl(imapUrl, nullptr, aURL);
     }
   } // if we have a url to run....
 
   return rv;
--- a/mailnews/imap/src/nsImapUndoTxn.cpp
+++ b/mailnews/imap/src/nsImapUndoTxn.cpp
@@ -280,17 +280,17 @@ nsImapMoveCopyMsgTxn::GetSrcKeyArray(nsT
     srcKeyArray = m_srcKeyArray;
     return NS_OK;
 }
 
 nsresult
 nsImapMoveCopyMsgTxn::AddDstKey(nsMsgKey aKey)
 {
     if (!m_dstMsgIdString.IsEmpty())
-        m_dstMsgIdString.Append(",");
+        m_dstMsgIdString.Append(',');
     m_dstMsgIdString.AppendInt((int32_t) aKey);
     return NS_OK;
 }
 
 nsresult
 nsImapMoveCopyMsgTxn::UndoMailboxDelete()
 {
     nsresult rv = NS_ERROR_FAILURE;
--- a/mailnews/import/becky/src/nsBeckyMail.cpp
+++ b/mailnews/import/becky/src/nsBeckyMail.cpp
@@ -356,17 +356,17 @@ static inline bool
 IsEndOfHeaders(const nsCString &aLine)
 {
   return aLine.IsEmpty();
 }
 
 static inline bool
 IsEndOfMessage(const nsCString &aLine)
 {
-  return aLine.Equals(".");
+  return aLine.EqualsLiteral(".");
 }
 
 class ImportMessageRunnable: public mozilla::Runnable
 {
 public:
   ImportMessageRunnable(nsIFile *aMessageFile,
                         nsIMsgFolder *aFolder);
   NS_DECL_NSIRUNNABLE
--- a/mailnews/import/becky/src/nsBeckySettings.cpp
+++ b/mailnews/import/becky/src/nsBeckySettings.cpp
@@ -185,32 +185,32 @@ nsBeckySettings::SetupSmtpServer(nsISmtp
     nsresult errorCode;
     port = value.ToInteger(&errorCode, 10);
   }
   server->SetPort(port);
 
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("SSLSMTP"),
                      value);
-  if (value.Equals("1"))
+  if (value.EqualsLiteral("1"))
     server->SetSocketType(nsMsgSocketType::SSL);
 
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("SMTPAUTH"),
                      value);
-  if (value.Equals("1")) {
+  if (value.EqualsLiteral("1")) {
     mParser->GetString(NS_LITERAL_CSTRING("Account"),
                        NS_LITERAL_CSTRING("SMTPAUTHMODE"),
                        value);
     nsMsgAuthMethodValue authMethod = nsMsgAuthMethod::none;
-    if (value.Equals("1")) {
+    if (value.EqualsLiteral("1")) {
       authMethod = nsMsgAuthMethod::passwordEncrypted;
-    } else if (value.Equals("2") ||
-               value.Equals("4") ||
-               value.Equals("6")) {
+    } else if (value.EqualsLiteral("2") ||
+               value.EqualsLiteral("4") ||
+               value.EqualsLiteral("6")) {
       authMethod = nsMsgAuthMethod::passwordCleartext;
     } else {
       authMethod = nsMsgAuthMethod::anything;
     }
     server->SetAuthMethod(authMethod);
   }
 
   server.forget(aServer);
@@ -223,33 +223,33 @@ nsBeckySettings::SetPop3ServerProperties
 {
   nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(aServer);
 
   nsAutoCString value;
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("POP3Auth"),
                      value); // 0: plain, 1: APOP, 2: CRAM-MD5, 3: NTLM
   nsMsgAuthMethodValue authMethod;
-  if (value.IsEmpty() || value.Equals("0")) {
+  if (value.IsEmpty() || value.EqualsLiteral("0")) {
     authMethod = nsMsgAuthMethod::passwordCleartext;
-  } else if (value.Equals("1")) {
+  } else if (value.EqualsLiteral("1")) {
     authMethod = nsMsgAuthMethod::old;
-  } else if (value.Equals("2")) {
+  } else if (value.EqualsLiteral("2")) {
     authMethod = nsMsgAuthMethod::passwordEncrypted;
-  } else if (value.Equals("3")) {
+  } else if (value.EqualsLiteral("3")) {
     authMethod = nsMsgAuthMethod::NTLM;
   } else {
     authMethod = nsMsgAuthMethod::none;
   }
   aServer->SetAuthMethod(authMethod);
 
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("LeaveServer"),
                      value);
-  if (value.Equals("1")) {
+  if (value.EqualsLiteral("1")) {
     pop3Server->SetLeaveMessagesOnServer(true);
     nsresult rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
                                      NS_LITERAL_CSTRING("KeepDays"),
                                      value);
     if (NS_FAILED(rv))
       return NS_OK;
 
     nsresult errorCode;
@@ -266,17 +266,17 @@ nsBeckySettings::SetPop3ServerProperties
 nsresult
 nsBeckySettings::SetupIncomingServer(nsIMsgIncomingServer **aServer)
 {
   nsAutoCString value;
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("Protocol"),
                      value);
   nsCString protocol;
-  if (value.Equals("1")) {
+  if (value.EqualsLiteral("1")) {
     protocol = NS_LITERAL_CSTRING("imap");
   } else {
     protocol = NS_LITERAL_CSTRING("pop3");
   }
 
   nsAutoCString userName, serverName;
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("MailServer"),
@@ -300,41 +300,41 @@ nsBeckySettings::SetupIncomingServer(nsI
                             value);
     if (NS_SUCCEEDED(rv))
       port = value.ToInteger(&errorCode, 10);
     else
       port = 110;
     mParser->GetString(NS_LITERAL_CSTRING("Account"),
                        NS_LITERAL_CSTRING("SSLPOP"),
                        value);
-    if (value.Equals("1"))
+    if (value.EqualsLiteral("1"))
       isSecure = true;
   } else if (protocol.EqualsLiteral("imap")) {
     rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
                             NS_LITERAL_CSTRING("IMAP4Port"),
                             value);
     if (NS_SUCCEEDED(rv))
       port = value.ToInteger(&errorCode, 10);
     else
       port = 143;
     mParser->GetString(NS_LITERAL_CSTRING("Account"),
                        NS_LITERAL_CSTRING("SSLIMAP"),
                        value);
-    if (value.Equals("1"))
+    if (value.EqualsLiteral("1"))
       isSecure = true;
   }
 
   server->SetPort(port);
   if (isSecure)
     server->SetSocketType(nsMsgSocketType::SSL);
 
   mParser->GetString(NS_LITERAL_CSTRING("Account"),
                      NS_LITERAL_CSTRING("CheckInt"),
                      value);
-  if (value.Equals("1"))
+  if (value.EqualsLiteral("1"))
     server->SetDoBiff(true);
   rv = mParser->GetString(NS_LITERAL_CSTRING("Account"),
                           NS_LITERAL_CSTRING("CheckEvery"),
                           value);
   if (NS_SUCCEEDED(rv)) {
     int32_t minutes = value.ToInteger(&errorCode, 10);
     if (NS_SUCCEEDED(errorCode))
       server->SetBiffMinutes(minutes);
--- a/mailnews/import/outlook/src/MapiMessage.cpp
+++ b/mailnews/import/outlook/src/MapiMessage.cpp
@@ -727,17 +727,17 @@ bool CMapiMessage::FetchBody(void)
     const char* charset = nsMsgI18NFileSystemCharset();
     if (charset) {
       bFoundCharset = CheckBodyInCharsetRange(charset);
       if (bFoundCharset)
         m_mimeCharset.Assign(charset);
     }
   }
   if (!bFoundCharset) // Everything else failed, let's use the lossless utf-8...
-    m_mimeCharset.Assign("utf-8");
+    m_mimeCharset.AssignLiteral("utf-8");
 
   MAPI_DUMP_STRING(m_body.get());
   MAPI_TRACE0("\r\n");
 
   return true;
 }
 
 void CMapiMessage::GetBody(nsCString& dest) const
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1619,17 +1619,17 @@ nsresult nsParseMailMessageState::Finali
           ParseString(oldKeywords, ' ', oldKeywordArray);
           for (uint32_t i = 0; i < oldKeywordArray.Length(); i++)
             if (!newKeywordArray.Contains(oldKeywordArray[i]))
               newKeywordArray.AppendElement(oldKeywordArray[i]);
           nsAutoCString newKeywords;
           for (uint32_t i = 0; i < newKeywordArray.Length(); i++)
           {
             if (i)
-              newKeywords.Append(" ");
+              newKeywords.Append(' ');
             newKeywords.Append(newKeywordArray[i]);
           }
           m_newMsgHdr->SetStringProperty("keywords", newKeywords.get());
         }
         for (uint32_t i = 0; i < m_customDBHeaders.Length(); i++)
         {
           if (m_customDBHeaderValues[i].length)
             m_newMsgHdr->SetStringProperty(m_customDBHeaders[i].get(), m_customDBHeaderValues[i].value);
--- a/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
+++ b/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.cpp
@@ -377,24 +377,24 @@ nsPgpMimeProxy::Finish() {
     return mDecryptor->OnStopRequest((nsIRequest*) this, nullptr, NS_OK);
   }
   else {
 
     if (!mOutputFun)
       return NS_ERROR_FAILURE;
 
     nsCString temp;
-    temp.Append("Content-Type: text/html\r\nCharset: UTF-8\r\n\r\n<html><body>");
-    temp.Append("<BR><text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#FF0000\" vlink=\"#800080\" alink=\"#0000FF\">");
-    temp.Append("<center><table BORDER=1 ><tr><td><CENTER>");
+    temp.AppendLiteral("Content-Type: text/html\r\nCharset: UTF-8\r\n\r\n<html><body>");
+    temp.AppendLiteral("<BR><text=\"#000000\" bgcolor=\"#FFFFFF\" link=\"#FF0000\" vlink=\"#800080\" alink=\"#0000FF\">");
+    temp.AppendLiteral("<center><table BORDER=1 ><tr><td><CENTER>");
 
     nsCString tString;
     PgpMimeGetNeedsAddonString(tString);
     temp.Append(tString);
-    temp.Append("</CENTER></td></tr></table></center><BR></body></html>\r\n");
+    temp.AppendLiteral("</CENTER></td></tr></table></center><BR></body></html>\r\n");
 
     PR_SetError(0,0);
     int status = mOutputFun(temp.get(), temp.Length(), mOutputClosure);
     if (status < 0) {
       PR_SetError(status, 0);
       mOutputFun = nullptr;
       return NS_ERROR_FAILURE;
     }
--- a/mailnews/mime/emitters/nsMimeBaseEmitter.cpp
+++ b/mailnews/mime/emitters/nsMimeBaseEmitter.cpp
@@ -814,23 +814,23 @@ nsMimeBaseEmitter::WriteHeaderFieldHTML(
     nsAppendEscapedHTML(nsDependentCString(i18nValue), newValue);
   }
 
   free(i18nValue);
 
   if (newValue.IsEmpty())
     return NS_OK;
 
-  mHTMLHeaders.Append("<tr>");
-  mHTMLHeaders.Append("<td>");
+  mHTMLHeaders.AppendLiteral("<tr>");
+  mHTMLHeaders.AppendLiteral("<td>");
 
   if (mFormat == nsMimeOutput::nsMimeMessageSaveAs)
-    mHTMLHeaders.Append("<b>");
+    mHTMLHeaders.AppendLiteral("<b>");
   else
-    mHTMLHeaders.Append("<div class=\"headerdisplayname\" style=\"display:inline;\">");
+    mHTMLHeaders.AppendLiteral("<div class=\"headerdisplayname\" style=\"display:inline;\">");
 
   // Here is where we are going to try to L10N the tagName so we will always
   // get a field name next to an emitted header value. Note: Default will always
   // be the name of the header itself.
   //
   nsCString newTagName(field);
   newTagName.StripWhitespace();
   ToUpperCase(newTagName);
@@ -839,59 +839,59 @@ nsMimeBaseEmitter::WriteHeaderFieldHTML(
   if ( (!l10nTagName) || (!*l10nTagName) )
     mHTMLHeaders.Append(field);
   else
   {
     mHTMLHeaders.Append(l10nTagName);
     PR_FREEIF(l10nTagName);
   }
 
-  mHTMLHeaders.Append(": ");
+  mHTMLHeaders.AppendLiteral(": ");
   if (mFormat == nsMimeOutput::nsMimeMessageSaveAs)
-    mHTMLHeaders.Append("</b>");
+    mHTMLHeaders.AppendLiteral("</b>");
   else
-    mHTMLHeaders.Append("</div>");
+    mHTMLHeaders.AppendLiteral("</div>");
 
   // Now write out the actual value itself and move on!
   //
   mHTMLHeaders.Append(newValue);
-  mHTMLHeaders.Append("</td>");
+  mHTMLHeaders.AppendLiteral("</td>");
 
-  mHTMLHeaders.Append("</tr>");
+  mHTMLHeaders.AppendLiteral("</tr>");
 
   return NS_OK;
 }
 
 nsresult
 nsMimeBaseEmitter::WriteHeaderFieldHTMLPrefix(const nsACString &name)
 {
   if (
       ( (mFormat == nsMimeOutput::nsMimeMessageSaveAs) && (mFirstHeaders) ) ||
       ( (mFormat == nsMimeOutput::nsMimeMessagePrintOutput) && (mFirstHeaders) )
      )
      /* DO NOTHING */ ;   // rhp: Do nothing...leaving the conditional like this so its
                           //      easier to see the logic of what is going on.
   else {
-    mHTMLHeaders.Append("<br><fieldset class=\"mimeAttachmentHeader\">");
+    mHTMLHeaders.AppendLiteral("<br><fieldset class=\"mimeAttachmentHeader\">");
     if (!name.IsEmpty()) {
-      mHTMLHeaders.Append("<legend class=\"mimeAttachmentHeaderName\">");
+      mHTMLHeaders.AppendLiteral("<legend class=\"mimeAttachmentHeaderName\">");
       nsAppendEscapedHTML(name, mHTMLHeaders);
-      mHTMLHeaders.Append("</legend>");
+      mHTMLHeaders.AppendLiteral("</legend>");
     }
-    mHTMLHeaders.Append("</fieldset>");
+    mHTMLHeaders.AppendLiteral("</fieldset>");
   }
 
   mFirstHeaders = false;
   return NS_OK;
 }
 
 nsresult
 nsMimeBaseEmitter::WriteHeaderFieldHTMLPostfix()
 {
-  mHTMLHeaders.Append("<br>");
+  mHTMLHeaders.AppendLiteral("<br>");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMimeBaseEmitter::WriteHTMLHeaders(const nsACString &name)
 {
   WriteHeaderFieldHTMLPrefix(name);
 
@@ -915,29 +915,29 @@ nsMimeBaseEmitter::WriteHTMLHeaders(cons
   mHTMLHeaders = "";
 
   return NS_OK;
 }
 
 nsresult
 nsMimeBaseEmitter::DumpSubjectFromDate()
 {
-  mHTMLHeaders.Append("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part1\">");
+  mHTMLHeaders.AppendLiteral("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part1\">");
 
     // This is the envelope information
     OutputGenericHeader(HEADER_SUBJECT);
     OutputGenericHeader(HEADER_FROM);
     OutputGenericHeader(HEADER_DATE);
 
     // If we are Quoting a message, then we should dump the To: also
     if ( ( mFormat == nsMimeOutput::nsMimeMessageQuoting ) ||
          ( mFormat == nsMimeOutput::nsMimeMessageBodyQuoting ) )
       OutputGenericHeader(HEADER_TO);
 
-  mHTMLHeaders.Append("</table>");
+  mHTMLHeaders.AppendLiteral("</table>");
 
   return NS_OK;
 }
 
 nsresult
 nsMimeBaseEmitter::DumpToCC()
 {
   const char * toField = GetHeaderValue(HEADER_TO);
@@ -945,39 +945,39 @@ nsMimeBaseEmitter::DumpToCC()
   const char * bccField = GetHeaderValue(HEADER_BCC);
   const char * newsgroupField = GetHeaderValue(HEADER_NEWSGROUPS);
 
   // only dump these fields if we have at least one of them! When displaying news
   // messages that didn't have a To or Cc field, we'd always get an empty box
   // which looked weird.
   if (toField || ccField || bccField || newsgroupField)
   {
-    mHTMLHeaders.Append("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part2\">");
+    mHTMLHeaders.AppendLiteral("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part2\">");
 
     if (toField)
       WriteHeaderFieldHTML(HEADER_TO, toField);
     if (ccField)
       WriteHeaderFieldHTML(HEADER_CC, ccField);
     if (bccField)
       WriteHeaderFieldHTML(HEADER_BCC, bccField);
     if (newsgroupField)
       WriteHeaderFieldHTML(HEADER_NEWSGROUPS, newsgroupField);
 
-    mHTMLHeaders.Append("</table>");
+    mHTMLHeaders.AppendLiteral("</table>");
   }
 
   return NS_OK;
 }
 
 nsresult
 nsMimeBaseEmitter::DumpRestOfHeaders()
 {
   nsTArray<headerInfoType*> *array = mDocHeader? mHeaderArray : mEmbeddedHeaderArray;
 
-  mHTMLHeaders.Append("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part3\">");
+  mHTMLHeaders.AppendLiteral("<table border=0 cellspacing=0 cellpadding=0 width=\"100%\" class=\"header-part3\">");
 
   for (size_t i = 0; i < array->Length(); i++)
   {
     headerInfoType *headerInfo = array->ElementAt(i);
     if ( (!headerInfo) || (!headerInfo->name) || (!(*headerInfo->name)) ||
       (!headerInfo->value) || (!(*headerInfo->value)))
       continue;
 
@@ -986,17 +986,17 @@ nsMimeBaseEmitter::DumpRestOfHeaders()
       (!PL_strcasecmp(HEADER_FROM, headerInfo->name)) ||
       (!PL_strcasecmp(HEADER_TO, headerInfo->name)) ||
       (!PL_strcasecmp(HEADER_CC, headerInfo->name)) )
       continue;
 
     WriteHeaderFieldHTML(headerInfo->name, headerInfo->value);
   }
 
-  mHTMLHeaders.Append("</table>");
+  mHTMLHeaders.AppendLiteral("</table>");
   return NS_OK;
 }
 
 nsresult
 nsMimeBaseEmitter::OutputGenericHeader(const char *aHeaderVal)
 {
   const char *val = GetHeaderValue(aHeaderVal);
 
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1991,25 +1991,25 @@ mime_decompose_file_init_fn(void *stream
     nsCOMPtr<nsIMIMEService> mimeFinder(do_GetService(NS_MIMESERVICE_CONTRACTID, &rv));
     if (NS_SUCCEEDED(rv) && mimeFinder)
     {
       nsAutoCString fileExtension;
       rv = mimeFinder->GetPrimaryExtension(contentType, EmptyCString(), fileExtension);
 
       if (NS_SUCCEEDED(rv) && !fileExtension.IsEmpty())
       {
-        newAttachName.Append(".");
+        newAttachName.Append('.');
         newAttachName.Append(fileExtension);
         extensionAdded = true;
       }
     }
 
     if (!extensionAdded)
     {
-      newAttachName.Append(".tmp");
+      newAttachName.AppendLiteral(".tmp");
     }
 
     nsMsgCreateTempFile(newAttachName.get(), getter_AddRefs(tmpFile));
   }
   nsresult rv;
 
   // This needs to be done so the attachment structure has a handle
   // on the temp file for this attachment...
--- a/mailnews/mime/src/mimemoz2.cpp
+++ b/mailnews/mime/src/mimemoz2.cpp
@@ -444,40 +444,40 @@ GenerateAttachmentData(MimeObject *objec
     else
       tmp->m_realName.Adopt(mime_part_address(object));
   } else {
     tmp->m_hasFilename = true;
   }
 
   if (!tmp->m_realName.IsEmpty() && !tmp->m_isExternalAttachment)
   {
-    urlString.Append("&filename=");
+    urlString.AppendLiteral("&filename=");
     nsAutoCString aResult;
     if (NS_SUCCEEDED(MsgEscapeString(tmp->m_realName,
                                      nsINetUtil::ESCAPE_XALPHAS, aResult)))
       urlString.Append(aResult);
     else
       urlString.Append(tmp->m_realName);
     if (tmp->m_realType.EqualsLiteral("message/rfc822") &&
            !StringEndsWith(urlString, NS_LITERAL_CSTRING(".eml"), nsCaseInsensitiveCStringComparator()))
-      urlString.Append(".eml");
+      urlString.AppendLiteral(".eml");
   } else if (tmp->m_isExternalAttachment) {
     // Allows the JS mime emitter to figure out the part information.
-    urlString.Append("?part=");
+    urlString.AppendLiteral("?part=");
     urlString.Append(part);
   } else if (tmp->m_realType.LowerCaseEqualsLiteral(MESSAGE_RFC822)) {
     // Special case...if this is a enclosed RFC822 message, give it a nice
     // name.
     if (object->headers->munged_subject)
     {
       nsCString subject;
       subject.Assign(object->headers->munged_subject);
       MimeHeaders_convert_header_value(options, subject, false);
       tmp->m_realName.Assign(subject);
-      tmp->m_realName.Append(".eml");
+      tmp->m_realName.AppendLiteral(".eml");
     }
     else
       tmp->m_realName = "ForwardedMessage.eml";
   }
 
   nsresult rv = nsMimeNewURI(getter_AddRefs(tmp->m_url), urlString.get(), nullptr);
 
   PR_FREEIF(urlSpec);
@@ -664,17 +664,17 @@ NotifyEmittersOfAttachmentList(MimeDispl
     //   "attachment" or if it can't be displayed inline.
     // - If there's no name at all, just skip it (we don't know what to do with
     //   it then).
     // - If the attachment has a "provided name" (i.e. not something like "Part
     //   1.2"), display it.
     // - If we're asking for all body parts and NOT asking for metadata only,
     //   display it.
     // - Otherwise, skip it.
-    if (!tmp->m_disposition.Equals("attachment") && tmp->m_displayableInline &&
+    if (!tmp->m_disposition.EqualsLiteral("attachment") && tmp->m_displayableInline &&
         (tmp->m_realName.IsEmpty() || (!tmp->m_hasFilename &&
         (opt->html_as_p != 4 || opt->metadata_only))))
     {
       ++i;
       ++tmp;
       continue;
     }
 
@@ -2001,17 +2001,17 @@ nsresult GetMailNewsFont(MimeObject *obj
     MimeInlineText  *text = (MimeInlineText *) obj;
     nsAutoCString charset;
 
     // get a charset
     if (!text->initializeCharset)
       ((MimeInlineTextClass*)&mimeInlineTextClass)->initialize_charset(obj);
 
     if (!text->charset || !(*text->charset))
-      charset.Assign("us-ascii");
+      charset.AssignLiteral("us-ascii");
     else
       charset.Assign(text->charset);
 
     nsCOMPtr<nsICharsetConverterManager> charSetConverterManager2;
     nsAutoCString prefStr;
 
     ToLowerCase(charset);
 
--- a/mailnews/mime/src/mimemrel.cpp
+++ b/mailnews/mime/src/mimemrel.cpp
@@ -473,17 +473,17 @@ MimeMultipartRelated_output_child_p(Mime
           }
 
           /*
             AppleDouble part need special care: we need to output only the data fork part of it.
             The problem at this point is that we haven't yet decoded the children of the AppleDouble
             part therfore we will have to hope the datafork is the second one!
           */
           if (mime_typep(child, (MimeObjectClass *) &mimeMultipartAppleDoubleClass))
-            partnum.Append(".2");
+            partnum.AppendLiteral(".2");
 
           char* part;
           if (!imappartnum.IsEmpty())
             part = mime_set_url_imap_part(obj->options->url, imappartnum.get(), partnum.get());
           else
           {
             char *no_part_url = nullptr;
             if (obj->options->part_to_load && obj->options->format_out == nsMimeOutput::nsMimeMessageBodyDisplay)
--- a/mailnews/mime/src/mimetpla.cpp
+++ b/mailnews/mime/src/mimetpla.cpp
@@ -44,35 +44,35 @@ MimeTextBuildPrefixCSS(int32_t    quoted
                        char       *citationColor,      // mail.citation_color
                        nsACString &style)
 {
   switch (quotedStyleSetting)
   {
   case 0:     // regular
     break;
   case 1:     // bold
-    style.Append("font-weight: bold; ");
+    style.AppendLiteral("font-weight: bold; ");
     break;
   case 2:     // italic
-    style.Append("font-style: italic; ");
+    style.AppendLiteral("font-style: italic; ");
     break;
   case 3:     // bold-italic
-    style.Append("font-weight: bold; font-style: italic; ");
+    style.AppendLiteral("font-weight: bold; font-style: italic; ");
     break;
   }
 
   switch (quotedSizeSetting)
   {
   case 0:     // regular
     break;
   case 1:     // large
-    style.Append("font-size: large; ");
+    style.AppendLiteral("font-size: large; ");
     break;
   case 2:     // small
-    style.Append("font-size: small; ");
+    style.AppendLiteral("font-size: small; ");
     break;
   }
 
   if (citationColor && *citationColor)
   {
     style += "color: ";
     style += citationColor;
     style += ';';
--- a/mailnews/mime/src/nsStreamConverter.cpp
+++ b/mailnews/mime/src/nsStreamConverter.cpp
@@ -367,17 +367,17 @@ nsStreamConverter::DetermineOutputFormat
       // Don't muck with this data!
       *aNewType = nsMimeOutput::nsMimeMessageRaw;
       return NS_OK;
     }
   }
 
   // is this is a part that should just come out raw
   const char *part = FindQueryElementData(queryPart, "part=");
-  if (part && !mToType.Equals("application/vnd.mozilla.xul+xml"))
+  if (part && !mToType.EqualsLiteral("application/vnd.mozilla.xul+xml"))
   {
     // default for parts
     mOutputFormat = "raw";
     *aNewType = nsMimeOutput::nsMimeMessageRaw;
 
     // if we are being asked to fetch a part....it should have a
     // content type appended to it...if it does, we want to remember
     // that as mOutputFormat
@@ -389,23 +389,23 @@ nsStreamConverter::DetermineOutputFormat
         typeField = secondTypeField;
     }
     if (typeField)
     {
       // store the real content type...mOutputFormat gets deleted later on...
       // and make sure we only get our own value.
       char *nextField = PL_strchr(typeField, '&');
       mRealContentType.Assign(typeField, nextField ? nextField - typeField : -1);
-      if (mRealContentType.Equals("message/rfc822"))
+      if (mRealContentType.EqualsLiteral("message/rfc822"))
       {
         mRealContentType = "application/x-message-display";
         mOutputFormat = "text/html";
         *aNewType = nsMimeOutput::nsMimeMessageBodyDisplay;
       }
-      else if (mRealContentType.Equals("application/x-message-display"))
+      else if (mRealContentType.EqualsLiteral("application/x-message-display"))
       {
         mRealContentType = "";
         mOutputFormat = "text/html";
         *aNewType = nsMimeOutput::nsMimeMessageBodyDisplay;
       }
     }
 
     return NS_OK;
@@ -680,17 +680,17 @@ NS_IMETHODIMP nsStreamConverter::GetCont
   if (!aOutputContentType)
     return NS_ERROR_NULL_POINTER;
 
   // since this method passes a string through an IDL file we need to use nsMemory to allocate it
   // and not strdup!
   //  (1) check to see if we have a real content type...use it first...
   if (!mRealContentType.IsEmpty())
     *aOutputContentType = ToNewCString(mRealContentType);
-  else if (mOutputFormat.Equals("raw"))
+  else if (mOutputFormat.EqualsLiteral("raw"))
     *aOutputContentType = (char *) nsMemory::Clone(UNKNOWN_CONTENT_TYPE, sizeof(UNKNOWN_CONTENT_TYPE));
   else
     *aOutputContentType = ToNewCString(mOutputFormat);
   return NS_OK;
 }
 
 //
 // This is the type of output operation that is being requested by libmime. The types
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -810,17 +810,17 @@ nsNntpIncomingServer::WriteHostInfoFile(
     return NS_ERROR_UNEXPECTED;
   nsCOMPtr<nsIOutputStream> hostInfoStream;
   rv = MsgNewBufferedFileOutputStream(getter_AddRefs(hostInfoStream), mHostInfoFile, -1, 00600);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // XXX TODO: missing some formatting, see the 4.x code
   nsAutoCString header("# News host information file.");
   WriteLine(hostInfoStream, header);
-  header.Assign("# This is a generated file!  Do not edit.");
+  header.AssignLiteral("# This is a generated file!  Do not edit.");
   WriteLine(hostInfoStream, header);
   header.Truncate();
   WriteLine(hostInfoStream, header);
   nsAutoCString version("version=");
   version.AppendInt(VALID_VERSION);
   WriteLine(hostInfoStream, version);
   nsAutoCString newsrcname("newsrcname=");
   newsrcname.Append(hostname);
--- a/mailnews/news/src/nsNntpService.cpp
+++ b/mailnews/news/src/nsNntpService.cpp
@@ -217,17 +217,17 @@ nsNntpService::DisplayMessage(const char
   // you are reading a message that you've already read, you
   // (from a cross post) it would be in your cache.
   rv = CreateMessageIDURL(folder, key, getter_Copies(urlStr));
   NS_ENSURE_SUCCESS(rv,rv);
 
   // rhp: If we are displaying this message for the purposes of printing, append
   // the magic operand.
   if (mPrintingOperation)
-    urlStr.Append("?header=print");
+    urlStr.AppendLiteral("?header=print");
 
   nsNewsAction action = nsINntpUrl::ActionFetchArticle;
   if (mOpenAttachmentOperation)
     action = nsINntpUrl::ActionFetchPart;
 
   nsCOMPtr<nsIURI> url;
   rv = ConstructNntpUrl(urlStr.get(), aUrlListener, aMsgWindow, aMessageURI, action, getter_AddRefs(url));
   NS_ENSURE_SUCCESS(rv,rv);