From 85df707cc96e15544776546f5477e157bed39283 Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Sun, 25 Apr 1999 01:43:06 +0000 Subject: [PATCH] perf improvement for macaddict.com (and others) git-svn-id: svn://10.0.0.236/trunk@29092 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/htmlparser/src/nsHTMLTokens.cpp | 5 ++++- mozilla/parser/htmlparser/src/nsHTMLTokens.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/htmlparser/src/nsHTMLTokens.cpp b/mozilla/htmlparser/src/nsHTMLTokens.cpp index 74158f91f9f..c7fdb8935a6 100644 --- a/mozilla/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/htmlparser/src/nsHTMLTokens.cpp @@ -29,6 +29,7 @@ #include "nsHTMLTags.h" #include "nsHTMLEntities.h" #include "nsCRT.h" +#include "nsStr.h" //#define GESS_MACHINE #ifdef GESS_MACHINE @@ -1589,7 +1590,9 @@ nsresult CSkippedContentToken::Consume(PRUnichar aChar,nsScanner& aScanner) { temp+=aChar; result=aScanner.ReadUntil(temp,kLessThan,PR_FALSE); } - done=PRBool(kNotFound!=temp.RFind(mTextValue,PR_TRUE)); + nsAutoString temp2; + temp.Right(temp2,mTextValue.Length()); + done=PRBool(0==temp2.Compare(mTextValue.GetUnicode(),PR_TRUE,mTextValue.Length())); } int len=temp.Length(); temp.Truncate(len-mTextValue.Length()); diff --git a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp index 74158f91f9f..c7fdb8935a6 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLTokens.cpp @@ -29,6 +29,7 @@ #include "nsHTMLTags.h" #include "nsHTMLEntities.h" #include "nsCRT.h" +#include "nsStr.h" //#define GESS_MACHINE #ifdef GESS_MACHINE @@ -1589,7 +1590,9 @@ nsresult CSkippedContentToken::Consume(PRUnichar aChar,nsScanner& aScanner) { temp+=aChar; result=aScanner.ReadUntil(temp,kLessThan,PR_FALSE); } - done=PRBool(kNotFound!=temp.RFind(mTextValue,PR_TRUE)); + nsAutoString temp2; + temp.Right(temp2,mTextValue.Length()); + done=PRBool(0==temp2.Compare(mTextValue.GetUnicode(),PR_TRUE,mTextValue.Length())); } int len=temp.Length(); temp.Truncate(len-mTextValue.Length());