changeset 31450:82556406aa45

(filtered-frame-list): Reduce consing. (frames-on-display-list): Call frame-parameter instead of frame-parameters.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 07 Sep 2000 11:39:07 +0000
parents 8797df6a9fa2
children 0f9e55c33cc5
files lisp/frame.el
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/frame.el	Thu Sep 07 11:37:48 2000 +0000
+++ b/lisp/frame.el	Thu Sep 07 11:39:07 2000 +0000
@@ -494,13 +494,13 @@
 
 (defun filtered-frame-list (predicate)
   "Return a list of all live frames which satisfy PREDICATE."
-  (let ((frames (frame-list))
-	good-frames)
+  (let* ((frames (frame-list))
+	 (list frames))
     (while (consp frames)
-      (if (funcall predicate (car frames))
-	  (setq good-frames (cons (car frames) good-frames)))
+      (unless (funcall predicate (car frames))
+	(setcar frames nil))
       (setq frames (cdr frames)))
-    good-frames))
+    (delq nil list)))
 
 (defun minibuffer-frame-list ()
   "Return a list of all frames with their own minibuffers."
@@ -512,12 +512,9 @@
   "Return a list of all frames on DISPLAY.
 DISPLAY is a name of a display, a string of the form HOST:SERVER.SCREEN.
 If DISPLAY is omitted or nil, it defaults to the selected frame's display."
-  (let* ((display (or display
-		      (cdr (assoc 'display (frame-parameters)))))
-	 (func
-	  (function (lambda (frame)
-		      (eq (cdr (assoc 'display (frame-parameters frame)))
-			  display)))))
+  (let* ((display (or display (frame-parameter nil 'display)))
+	 (func #'(lambda (frame)
+		   (eq (frame-parameter frame 'display) display))))
     (filtered-frame-list func)))
 
 (defun framep-on-display (&optional display)