branch: elpa/magit
commit 4d0a38ca87801e4fed673d904d536d1fb3f5b925
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit-file-{line,lines}: Cosmetics
---
 lisp/magit-base.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index cf775c4ddee..393d3e10185 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -930,19 +930,19 @@ If optional NUM is specified, only delete that 
subexpression."
 
 (defun magit-file-line (file)
   "Return the first line of FILE as a string."
-  (when (file-regular-p file)
-    (with-temp-buffer
-      (insert-file-contents file)
-      (buffer-substring-no-properties (point-min)
-                                      (line-end-position)))))
+  (and (file-regular-p file)
+       (with-temp-buffer
+         (insert-file-contents file)
+         (buffer-substring-no-properties (point-min)
+                                         (line-end-position)))))
 
 (defun magit-file-lines (file &optional keep-empty-lines)
   "Return a list of strings containing one element per line in FILE.
 Unless optional argument KEEP-EMPTY-LINES is t, trim all empty lines."
-  (when (file-regular-p file)
-    (with-temp-buffer
-      (insert-file-contents file)
-      (split-string (buffer-string) "\n" (not keep-empty-lines)))))
+  (and (file-regular-p file)
+       (with-temp-buffer
+         (insert-file-contents file)
+         (split-string (buffer-string) "\n" (not keep-empty-lines)))))
 
 (defun magit-set-header-line-format (string)
   "Set `header-line-format' in the current buffer based on STRING.

Reply via email to