]> git.eshelyaron.com Git - emacs.git/commitdiff
Also sort the totals section by size
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 11 Dec 2020 17:58:41 +0000 (18:58 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 11 Dec 2020 17:58:41 +0000 (18:58 +0100)
* lisp/emacs-lisp/memory-report.el (memory-report): Sort the
totals by size, too.

lisp/emacs-lisp/memory-report.el

index 0184c7ed8a53fb52c4f7894a6fc84ed0352a40a0..c88d9f2768a9bd9829b959919ce5227a60e31d7d 100644 (file)
@@ -59,7 +59,9 @@ by counted more than once."
       (if (listp report)
           (push report summaries)
         (push report details)))
-    (dolist (summary (nreverse summaries))
+    (dolist (summary (seq-sort (lambda (e1 e2)
+                                 (> (cdr e1) (cdr e2)))
+                               summaries))
       (insert (format "%s  %s\n"
                       (memory-report--format (cdr summary))
                       (car summary))))