Mercurial > hg > xemacs-beta
diff lisp/bytecomp/byte-optimize.el @ 142:1856695b1fa9 r20-2b5
Import from CVS: tag r20-2b5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:33:18 +0200 |
parents | 585fb297b004 |
children | 538048ae2ab8 |
line wrap: on
line diff
--- a/lisp/bytecomp/byte-optimize.el Mon Aug 13 09:32:45 2007 +0200 +++ b/lisp/bytecomp/byte-optimize.el Mon Aug 13 09:33:18 2007 +0200 @@ -649,10 +649,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 +697,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 +717,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 +728,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)