diff lisp/bytecomp/byte-optimize.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 56c54cf7c5b6
children 364816949b59
line wrap: on
line diff
--- a/lisp/bytecomp/byte-optimize.el	Mon Aug 13 09:00:04 2007 +0200
+++ b/lisp/bytecomp/byte-optimize.el	Mon Aug 13 09:02:59 2007 +0200
@@ -273,10 +273,7 @@
 	  form)
       ;; else
       (if (and (consp fn) (eq (car fn) 'autoload))
-	  (progn
-	    (load (nth 1 fn))
-	    (setq fn (or (cdr (assq name byte-compile-function-environment))
-			 (and (fboundp name) (symbol-function name))))))
+	  (load (nth 1 fn)))
       (if (and (consp fn) (eq (car fn) 'autoload))
 	  (error "file \"%s\" didn't define \"%s\"" (nth 1 fn) name))
       (if (symbolp fn)
@@ -649,10 +646,8 @@
 ;;      (byte-optimize-two-args-right form)
 ;;      form))
 
-;; jwz: (byte-optimize-approx-equal 0.0 0.0) was returning nil
-;; in xemacs 19.15 because it used < instead of <=.
 (defun byte-optimize-approx-equal (x y)
-  (<= (* (abs (- x y)) 100) (abs (+ x y))))
+  (< (* (abs (- x y)) 100) (abs (+ x y))))
 
 ;; Collect all the constants from FORM, after the STARTth arg,
 ;; and apply FUN to them to make one argument at the end.
@@ -699,22 +694,6 @@
 	 (condition-case ()
 	     (eval form)
 	   (error form)))
-
-	;; `add1' and `sub1' are a marginally fewer instructions
-	;; than `plus' and `minus', so use them when possible.
-	((and (null (nthcdr 3 form))
-	      (eq (nth 2 form) 1))
-	 (list '1+ (nth 1 form)))	; (+ x 1)  -->  (1+ x)
-	((and (null (nthcdr 3 form))
-	      (eq (nth 1 form) 1))
-	 (list '1+ (nth 2 form)))	; (+ 1 x)  -->  (1+ x)
-	((and (null (nthcdr 3 form))
-	      (eq (nth 2 form) -1))
-	 (list '1- (nth 1 form)))	; (+ x -1)  -->  (1- x)
-	((and (null (nthcdr 3 form))
-	      (eq (nth 1 form) -1))
-	 (list '1- (nth 2 form)))	; (+ -1 x)  -->  (1- x)
-
 ;;; It is not safe to delete the function entirely
 ;;; (actually, it would be safe if we know the sole arg
 ;;; is not a marker).
@@ -735,7 +714,6 @@
 		(numberp last))
 	   (setq form (nconc (list '- (- (nth 1 form) last) (nth 2 form))
 			     (delq last (copy-sequence (nthcdr 3 form))))))))
-  (setq form
 ;;; It is not safe to delete the function entirely
 ;;; (actually, it would be safe if we know the sole arg
 ;;; is not a marker).
@@ -747,18 +725,6 @@
 	 (cons (car form) (cdr (cdr form)))
        form))
 ;;;    )
-    )
-
-  ;; `add1' and `sub1' are a marginally fewer instructions than `plus'
-  ;; and `minus', so use them when possible.
-  (cond ((and (null (nthcdr 3 form))
-	      (eq (nth 2 form) 1))
-	 (list '1- (nth 1 form)))	; (- x 1)  -->  (1- x)
-	((and (null (nthcdr 3 form))
-	      (eq (nth 2 form) -1))
-	 (list '1+ (nth 1 form)))	; (- x -1)  -->  (1+ x)
-	(t
-	 form))
   )
 
 (defun byte-optimize-multiply (form)