changeset 19980:2b5cebd0da5e

(save-place-to-alist): Optimize out the degenerate case when point is 1.
author Karl Heuer <kwzh@gnu.org>
date Thu, 25 Sep 1997 01:01:05 +0000
parents 8540d32e89cd
children 1d135b4edfcb
files lisp/saveplace.el
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/saveplace.el	Thu Sep 25 00:53:39 1997 +0000
+++ b/lisp/saveplace.el	Thu Sep 25 01:01:05 1997 +0000
@@ -125,16 +125,17 @@
   (or save-place-loaded (load-save-place-alist-from-file))
   (if buffer-file-name
       (progn
-        (let ((cell (assoc buffer-file-name save-place-alist)))
+        (let ((cell (assoc buffer-file-name save-place-alist))
+	      (position (if (not (eq major-mode 'hexl-mode))
+			    (point)
+			  (1+ (hexl-current-address)))))
           (if cell
-              (setq save-place-alist (delq cell save-place-alist))))
-        (if save-place
-            (setq save-place-alist
-		  (cons (cons buffer-file-name
-			      (if (not (eq major-mode 'hexl-mode))
-				  (point)
-				(1+ (hexl-current-address))))
-                        save-place-alist))))))
+              (setq save-place-alist (delq cell save-place-alist)))
+	  (if (and save-place
+		   (not (= position 1)))  ;; Optimize out the degenerate case.
+	      (setq save-place-alist
+		    (cons (cons buffer-file-name position)
+			  save-place-alist)))))))
 
 (defun save-place-alist-to-file ()
   (let ((file (expand-file-name save-place-file)))