[PATCH 1/6] cli/new: use the same style for fs entry loops

Jani Nikula jani at nikula.org
Fri Sep 1 08:53:06 PDT 2017


Just to please the eyes. No functional changes.
---
 notmuch-new.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index e011788da590..c6a741fefa03 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -443,10 +443,7 @@ add_files (notmuch_database_t *notmuch,
     /* Pass 1: Recurse into all sub-directories. */
     is_maildir = _entries_resemble_maildir (path, fs_entries, num_fs_entries);
 
-    for (i = 0; i < num_fs_entries; i++) {
-	if (interrupted)
-	    break;
-
+    for (i = 0; i < num_fs_entries && ! interrupted; i++) {
 	entry = fs_entries[i];
 
 	/* Ignore any files/directories the user has configured to
@@ -514,11 +511,7 @@ add_files (notmuch_database_t *notmuch,
     }
 
     /* Pass 2: Scan for new files, removed files, and removed directories. */
-    for (i = 0; i < num_fs_entries; i++)
-    {
-	if (interrupted)
-	    break;
-
+    for (i = 0; i < num_fs_entries && ! interrupted; i++) {
         entry = fs_entries[i];
 
 	/* Ignore files & directories user has configured to be ignored */
-- 
2.11.0



More information about the notmuch mailing list