From 228f6acb38cb4a61a0c01a5bab89e743a6c4f34f Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sat, 9 Feb 2002 19:00:56 +0000 Subject: [PATCH] Testing performance impact of backout of part of patch from bug 115289. See bug 123947 for details. a=mcafee --- layout/generic/nsObjectFrame.cpp | 8 ++++---- layout/html/base/src/nsObjectFrame.cpp | 8 ++++---- layout/xul/base/src/nsMenuBarFrame.cpp | 3 +-- modules/libjar/nsJAR.cpp | 12 ++++-------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index bccbd6cf1a6a..87477451ebd2 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const // not to hide the once you'd put the 'hidden' attribute // on the tag... // these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed - if (!hidden.IsEmpty() && - !hidden.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) && - !hidden.Equals(NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) && - !hidden.Equals(NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator())) { + if (hidden.Length() && + (Compare(hidden, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) != 0) && + (Compare(hidden, NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) != 0) && + (Compare(hidden, NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator()) != 0)) { // The or is hidden. return PR_TRUE; } diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index bccbd6cf1a6a..87477451ebd2 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -1462,10 +1462,10 @@ nsObjectFrame::IsHidden() const // not to hide the once you'd put the 'hidden' attribute // on the tag... // these |NS_ConvertASCIItoUCS2|s can't be |NS_LITERAL_STRING|s until |EqualsIgnoreCase| get's fixed - if (!hidden.IsEmpty() && - !hidden.Equals(NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) && - !hidden.Equals(NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) && - !hidden.Equals(NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator())) { + if (hidden.Length() && + (Compare(hidden, NS_LITERAL_STRING("false"), nsCaseInsensitiveStringComparator()) != 0) && + (Compare(hidden, NS_LITERAL_STRING("no"), nsCaseInsensitiveStringComparator()) != 0) && + (Compare(hidden, NS_LITERAL_STRING("off"), nsCaseInsensitiveStringComparator()) != 0)) { // The or is hidden. return PR_TRUE; } diff --git a/layout/xul/base/src/nsMenuBarFrame.cpp b/layout/xul/base/src/nsMenuBarFrame.cpp index accd412a0a7c..326b60be9c9e 100644 --- a/layout/xul/base/src/nsMenuBarFrame.cpp +++ b/layout/xul/base/src/nsMenuBarFrame.cpp @@ -266,8 +266,7 @@ nsMenuBarFrame::FindMenuWithShortcut(PRUint32 aLetter) if (!shortcutKey.IsEmpty()) { // We've got something. PRUnichar letter = PRUnichar(aLetter); // throw away the high-zero-fill - if ( shortcutKey.Equals(Substring(&letter, &letter+1), - nsCaseInsensitiveStringComparator()) ) { + if ( Compare(shortcutKey, Substring(&letter, &letter+1), nsCaseInsensitiveStringComparator())==0 ) { // We match! nsCOMPtr menuFrame = do_QueryInterface(currFrame); if (menuFrame) diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp index 9424a53485ad..3ce71e8b8080 100644 --- a/modules/libjar/nsJAR.cpp +++ b/modules/libjar/nsJAR.cpp @@ -723,8 +723,7 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier, //-- Lines to look for: // (1) Digest: - if (lineName.Equals(NS_LITERAL_CSTRING("SHA1-Digest"), - nsCaseInsensitiveCStringComparator())) + if (Compare(lineName, NS_LITERAL_CSTRING("SHA1-Digest"), nsCaseInsensitiveCStringComparator()) == 0) //-- This is a digest line, save the data in the appropriate place { if(aFileType == JAR_MF) @@ -740,8 +739,7 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier, } // (2) Name: associates this manifest section with a file in the jar. - if (!foundName && lineName.Equals(NS_LITERAL_CSTRING("Name"), - nsCaseInsensitiveCStringComparator())) + if (!foundName && Compare(lineName, NS_LITERAL_CSTRING("Name"), nsCaseInsensitiveCStringComparator()) == 0) { curItemName = lineData; foundName = PR_TRUE; @@ -751,11 +749,9 @@ nsJAR::ParseOneFile(nsISignatureVerifier* verifier, // (3) Magic: this may be an inline Javascript. // We can't do any other kind of magic. if ( aFileType == JAR_MF && - lineName.Equals(NS_LITERAL_CSTRING("Magic"), - nsCaseInsensitiveCStringComparator())) + Compare(lineName, NS_LITERAL_CSTRING("Magic"), nsCaseInsensitiveCStringComparator()) == 0) { - if(lineData.Equals(NS_LITERAL_CSTRING("javascript"), - nsCaseInsensitiveCStringComparator())) + if(Compare(lineData, NS_LITERAL_CSTRING("javascript"), nsCaseInsensitiveCStringComparator()) == 0) curItemMF->mType = JAR_EXTERNAL; else curItemMF->mType = JAR_INVALID;