diff lisp/behavior.el @ 5271:2def0d83a5e3

Don't uselessly call #'nreverse, #'hash-table-key-list and friends. 2010-09-16 Aidan Kehoe <kehoea@parhasard.net> * hash-table.el (hash-table-key-list, hash-table-value-list) (hash-table-key-value-alist, hash-table-key-value-plist): Remove some useless #'nreverse calls in these files; our hash tables have no order, it's not helpful to pretend they do. * behavior.el (read-behavior): Do the same in this file, in some code evidently copied from hash-table.el.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 16 Sep 2010 16:46:27 +0100
parents ebb35ddea76a
children 308d34e9f07d
line wrap: on
line diff
--- a/lisp/behavior.el	Thu Sep 16 15:58:10 2010 +0100
+++ b/lisp/behavior.el	Thu Sep 16 16:46:27 2010 +0100
@@ -349,15 +349,11 @@
   (let ((result
 	 (completing-read
 	  prompt
-	  (let ((table (let (lis)
-			 (maphash #'(lambda (key val)
-				      (push (cons key val) lis))
-				  behavior-hash-table)
-			 (nreverse lis))))
-	    (mapc #'(lambda (aentry)
-		      (setcar aentry (symbol-name (car aentry))))
-		  table)
-	    table)
+	  (let (list)
+	    (maphash #'(lambda (key value)
+			 (push (cons (symbol-name key) value) list))
+		     behavior-hash-table)
+	    list)
 	  nil must-match initial-contents (or history 'behavior-history)
 	  default-value)))
     (if (and result (stringp result))