Bug 226439. Some small conversion to use EqualsLiteral to see effect on code size, r+sr=dbaron. Additionally, some comments to clarify that EqualsLiteral is only for actual literals, and to properly credit Corey Kosak who showed me the template trick. Also re-enabled the template for MSVC++ 7.1, which can apparently handle it.

This commit is contained in:
roc+@cs.cmu.edu
2004-04-28 17:48:02 +00:00
parent a84d3e7ea8
commit 521d9eb8e9
8 changed files with 18 additions and 8 deletions

View File

@@ -2639,9 +2639,9 @@ NS_IMETHODIMP nsPluginInstanceOwner::GetDocumentEncoding(const char* *result)
if (charset.IsEmpty()) return NS_OK;
// common charsets and those not requiring conversion first
if (charset == NS_LITERAL_CSTRING("us-acsii")) {
if (charset.EqualsLiteral("us-ascii")) {
*result = PL_strdup("US_ASCII");
} else if (charset == NS_LITERAL_CSTRING("ISO-8859-1") ||
} else if (charset.EqualsLiteral("ISO-8859-1") ||
!nsCRT::strncmp(PromiseFlatCString(charset).get(), "UTF", 3)) {
*result = ToNewCString(charset);
} else {