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
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