☠☠ backed out by be3ea7eb7ff4 ☠ ☠ | |
author | Nicholas Nethercote <nnethercote@mozilla.com> |
Fri, 19 Oct 2018 11:27:30 +1100 | |
changeset 497854 | eeea7ba794c30def2083f1a7555228b84d7b4626 |
parent 497853 | 9819dbed2d88c0aa7f4832a0cee383e68481ebd8 |
child 497855 | a4e7eb7be03c2d1b51fd3b3ee355720d999fb2a9 |
push id | 10002 |
push user | archaeopteryx@coole-files.de |
push date | Fri, 19 Oct 2018 23:09:29 +0000 |
treeherder | mozilla-beta@01378c910610 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | erahm |
bugs | 1499906 |
milestone | 64.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
toolkit/components/aboutmemory/content/aboutMemory.js | file | annotate | diff | comparison | revisions |
--- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -1483,17 +1483,17 @@ function appendProcessAboutMemoryElement // Now generate the elements, putting non-degenerate trees first. let pre = appendSectionHeader(aP, "Other Measurements"); for (let t of otherTrees) { appendTreeElements(pre, t, aProcess, ""); appendTextNode(pre, "\n"); // blank lines after non-degenerate trees } for (let t of otherDegenerates) { - let padText = pad("", maxStringLength - t.toString().length, " "); + let padText = "".padStart(maxStringLength - t.toString().length, " "); appendTreeElements(pre, t, aProcess, padText); } appendTextNode(aP, "\n"); // gives nice spacing when we copy and paste // Add any warnings about inaccuracies in the "explicit" tree due to platform // limitations. These must be computed after generating all the text. The // newlines give nice spacing if we copy+paste into a text buffer. if (hasExplicitTree) { @@ -1589,36 +1589,16 @@ function formatTreeFrac(aNum, aDenom) { // alignment. For positive numbers, 00.00%--99.99% works straighforwardly, // but 100.0% needs special handling. let num = aDenom === 0 ? 1 : (aNum / aDenom); return (0.99995 <= num && num <= 1) ? formatNum(1, kFrac1Style) : formatNum(num, kFracStyle); } -/** - * Right-justifies a string in a field of a given width, padding as necessary. - * - * @param aS - * The string. - * @param aN - * The field width. - * @param aC - * The char used to pad. - * @return The string representation. - */ -function pad(aS, aN, aC) { - let padding = ""; - let n2 = aN - aS.length; - for (let i = 0; i < n2; i++) { - padding += aC; - } - return padding + aS; -} - const kNoKidsSep = " ── ", kHideKidsSep = " ++ ", kShowKidsSep = " -- "; function appendMrNameSpan(aP, aDescription, aUnsafeName, aIsInvalid, aNMerged, aPresence) { let safeName = flipBackslashes(aUnsafeName); if (!aIsInvalid && !aNMerged && !aPresence) {