stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] [PATCH] Use (nconc foo bar) instead of (setf foo (append bar foo


From: Xan Lopez
Subject: [STUMP] [PATCH] Use (nconc foo bar) instead of (setf foo (append bar foo))
Date: Wed, 14 May 2008 18:46:54 +0100

It's more efficient and make-state-mask does not seem care about the order.
---
 kmap.lisp |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/kmap.lisp b/kmap.lisp
index eb0984b..5250b1b 100644
--- a/kmap.lisp
+++ b/kmap.lisp
@@ -86,11 +86,11 @@ modifier. Most of the time numlock just gets in the way."
   (let (mods)
     (when (key-shift key) (push :shift mods))
     (when (key-control key) (push :control mods))
-    (when (key-meta key) (setf mods (append (modifiers-meta *modifiers*) 
mods)))
-    (when (key-alt key) (setf mods (append (modifiers-alt *modifiers*) mods)))
-    (when (key-hyper key) (setf mods (append (modifiers-hyper *modifiers*) 
mods)))
-    (when (key-super key) (setf mods (append (modifiers-super *modifiers*) 
mods)))
-    (when with-numlock (setf mods (append (modifiers-numlock *modifiers*) 
mods)))
+    (when (key-meta key) (nconc mods (modifiers-meta *modifiers*)))
+    (when (key-alt key) (nconc mods (modifiers-alt *modifiers*)))
+    (when (key-hyper key) (nconc mods (modifiers-hyper *modifiers*)))
+    (when (key-super key) (nconc mods (modifiers-super *modifiers*)))
+    (when with-numlock (nconc mods (modifiers-numlock *modifiers*)))
     (apply 'xlib:make-state-mask mods)))
 
 (define-condition kbd-parse ()
-- 
1.5.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]