From 90a1b526dcf2dd7c2426f7228929cccea3a6a83a Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 12 Sep 2007 17:49:38 +0000 Subject: [PATCH] Testing performance impact of backout of what's left of the patch from bug 115289. See bug 123947 for details. a=mcafee git-svn-id: svn://10.0.0.236/trunk@235773 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/suite/browser/src/nsBookmarksService.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mozilla/suite/browser/src/nsBookmarksService.cpp b/mozilla/suite/browser/src/nsBookmarksService.cpp index ce3c067a751..5799f6f5938 100644 --- a/mozilla/suite/browser/src/nsBookmarksService.cpp +++ b/mozilla/suite/browser/src/nsBookmarksService.cpp @@ -934,22 +934,27 @@ BookmarkParser::Unescape(nsString &text) while((offset = text.FindChar((PRUnichar('&')), offset)) >= 0) { - if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator())) + // XXX get max of 6 chars; change the value below if + // we ever start looking for longer HTML-escaped values + nsAutoString temp; + text.Mid(temp, offset, 6); + + if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING("<"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 4); text.Insert(PRUnichar('<'), offset); } - else if (Substring(text, offset, 4).Equals(NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator())) + if (Compare(Substring(temp, 0, 4), NS_LITERAL_STRING(">"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 4); text.Insert(PRUnichar('>'), offset); } - else if (Substring(text, offset, 5).Equals(NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator())) + if (Compare(Substring(temp, 0, 5), NS_LITERAL_STRING("&"), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 5); text.Insert(PRUnichar('&'), offset); } - else if (Substring(text, offset, 6).Equals(NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator())) + if (Compare(Substring(temp, 0, 6), NS_LITERAL_STRING("""), nsCaseInsensitiveStringComparator()) == 0) { text.Cut(offset, 6); text.Insert(PRUnichar('\"'), offset);