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