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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user