Make parsing super-large script/cdata/whatever blocks faster by using

size_forward as a lower-bound estimate for actual distance to end of string.
Bug 171124, r+sr=dbaron


git-svn-id: svn://10.0.0.236/trunk@148516 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2003-10-30 02:34:03 +00:00
parent 468bc07efc
commit 881281f753
2 changed files with 4 additions and 2 deletions

View File

@@ -595,7 +595,8 @@ nsresult CTextToken::ConsumeUntil(PRUnichar aChar,PRBool aIgnoreComments,nsScann
PRBool found = PR_FALSE;
nsReadingIterator<PRUnichar> gtOffset,ltOffset = theCurrOffset;
while (FindCharInReadable(PRUnichar(kLessThan), ltOffset, endPos) &&
Distance(ltOffset, endPos) >= termStrLen) {
((PRUint32)ltOffset.size_forward() >= termStrLen ||
Distance(ltOffset, endPos) >= termStrLen)) {
// Make a copy of the (presumed) end tag and
// do a case-insensitive comparison