]> code.delx.au - gnu-emacs/blobdiff - lisp/profiler.el
* lisp/profiler.el (profiler-calltree-find): Use function-equal.
[gnu-emacs] / lisp / profiler.el
index 093a01a8602f29eb02b92588cae2f13c943caafe..93ab10015eaecb5f66495088ce82f8d854436c7f 100644 (file)
@@ -60,7 +60,7 @@
 (defun profiler-format-number (number)
   "Format NUMBER in human readable string."
   (if (and (integerp number) (> number 0))
-      (cl-loop with i = (% (1+ (floor (log10 number))) 3)
+      (cl-loop with i = (% (1+ (floor (log number 10))) 3)
               for c in (append (number-to-string number) nil)
               if (= i 0)
               collect ?, into s
@@ -256,10 +256,9 @@ Optional argument MODE means only check for the specified mode (cpu or mem)."
 (defun profiler-calltree-find (tree entry)
   "Return a child tree of ENTRY under TREE."
   (let (result (children (profiler-calltree-children tree)))
-    ;; FIXME: Use `assoc'.
     (while (and children (null result))
       (let ((child (car children)))
-       (when (equal (profiler-calltree-entry child) entry)
+       (when (function-equal (profiler-calltree-entry child) entry)
          (setq result child))
        (setq children (cdr children))))
     result))