Bug 636655 - Back out bug 582852 because of the performance regression it caused in creating large textnodes (while it was supposed to improve the performance); r,a=bzbarsky

This commit is contained in:
Ehsan Akhgari 2011-02-28 13:04:59 -08:00
Родитель 534e10eb7f
Коммит bfcee9518c
1 изменённых файлов: 7 добавлений и 12 удалений

Просмотреть файл

@ -202,18 +202,13 @@ nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
}
}
// We don't attempt to detect if large text nodes can be stored compactly,
// because that wastes too much time.
const PRInt32 LARGE_STRING_THRESHOLD = 10240; // 10KB
PRBool need2 = aLength >= LARGE_STRING_THRESHOLD;
if (!need2) {
// See if we need to store the data in ucs2 or not
while (ucp < uend) {
PRUnichar ch = *ucp++;
if (ch >= 256) {
need2 = PR_TRUE;
break;
}
// See if we need to store the data in ucs2 or not
PRBool need2 = PR_FALSE;
while (ucp < uend) {
PRUnichar ch = *ucp++;
if (ch >= 256) {
need2 = PR_TRUE;
break;
}
}