зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
534e10eb7f
Коммит
bfcee9518c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче