diff lisp/byte-optimize.el @ 464:5aa1854ad537 r21-2-47

Import from CVS: tag r21-2-47
author cvs
date Mon, 13 Aug 2007 11:45:51 +0200
parents 3d3049ae1304
children cf82e22962ce
line wrap: on
line diff
--- a/lisp/byte-optimize.el	Mon Aug 13 11:44:39 2007 +0200
+++ b/lisp/byte-optimize.el	Mon Aug 13 11:45:51 2007 +0200
@@ -729,9 +729,15 @@
       (decf (nth 1 form) last)
       (butlast form))
 
-     ;; (- 0 x ...)  -->  (- (- x) ...)
-     ((and (eq 0 (nth 1 form)) (>= (length form) 3))
-      `(- (- ,(nth 2 form)) ,@(nthcdr 3 form)))
+     ;; (- 0 ...) -->
+     ((eq 0 (nth 1 form))
+      (case (length form)
+	;; (- 0) --> 0
+	(2 0)
+	;; (- 0 x)  -->  (- x)
+	(3 `(- ,(nth 2 form)))
+	;; (- 0 x y ...)  -->  (- (- x) y ...)
+	(t `(- (- ,(nth 2 form)) ,@(nthcdr 3 form)))))
 
      (t (byte-optimize-predicate form)))))