Bug 755992 (part 2) - Optimize creation of tree lines in about:memory. r=nnethercote.

This commit is contained in:
Nils Maier 2012-05-16 23:43:34 -07:00
Родитель fa54bf9607
Коммит 8d3627fc86
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -1273,13 +1273,17 @@ function appendTreeElements(aPOuter, aT, aProcess)
// Indent more if this entry is narrower than its parent, and update
// aIndentGuide accordingly.
let tString = aT.toString();
let extraIndentArray = [];
let extraIndentLength = Math.max(aParentStringLength - tString.length, 0);
let indentText;
if (extraIndentLength > 0) {
let extraIndentArray = [];
repeatStr(extraIndentArray, kHorizontal, extraIndentLength);
aIndentGuide[aIndentGuide.length - 1]._depth += extraIndentLength;
indentText = aBaseIndentText + extraIndentArray.join("");
}
else {
indentText = aBaseIndentText;
}
let indentText = aBaseIndentText + extraIndentArray.join("");
appendElementWithText(aP, "span", "treeLine", indentText);
// Generate the percentage; detect and record invalid values at the same