2008-07-06 YAMASHITA Junji <ysiijj@gmail.com>
authorkaoru <kaoru>
Sun, 6 Jul 2008 06:40:48 +0000 (06:40 +0000)
committerkaoru <kaoru>
Sun, 6 Jul 2008 06:40:48 +0000 (06:40 +0000)
* elmo-pop3.el (elmo-pop3-read-contents): improving performance:
goto the previous end-point insead of the head-point, and use
`search-forward' instead of `re-search-forward'.

elmo/ChangeLog
elmo/elmo-pop3.el

index 4f7bb6a..2594f79 100644 (file)
@@ -1,3 +1,9 @@
+2008-07-06 YAMASHITA Junji <ysiijj@gmail.com>
+
+       * elmo-pop3.el (elmo-pop3-read-contents): improving performance:
+       goto the previous end-point insead of the head-point, and use
+       `search-forward' instead of `re-search-forward'.
+
 2008-06-30  Tetsurou Okazaki  <okazaki@be.to>
 
        * elmo-imap4.el (elmo-imap4-parse-status): Use `case' instead of `cond'.
index 85bb096..5538f50 100644 (file)
@@ -469,15 +469,14 @@ until the login delay period has expired"))
 (defun elmo-pop3-read-contents (process)
   (with-current-buffer (process-buffer process)
     (let ((case-fold-search nil)
-         match-end)
-      (goto-char elmo-pop3-read-point)
-      (while (not (re-search-forward "^\\.\r\n" nil t))
-       (accept-process-output process 1)
-       (goto-char elmo-pop3-read-point))
-      (setq match-end (point))
+         (point elmo-pop3-read-point))
+      (while (and (goto-char (max (- point 2) (point-min)))
+                 (not (search-forward "\r\n.\r\n" nil t)))
+       (setq point (goto-char (point-max)))
+       (accept-process-output process 1))
       (elmo-delete-cr
        (buffer-substring elmo-pop3-read-point
-                        (- match-end 3))))))
+                        (- (point) 3))))))
 
 (luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-pop3-folder))
   (convert-standard-filename