From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 251FF6DE0C78 for ; Wed, 25 Jan 2017 12:18:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.508 X-Spam-Level: X-Spam-Status: No, score=0.508 tagged_above=-999 required=5 tests=[AWL=-0.144, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y07pzSK8IsAV for ; Wed, 25 Jan 2017 12:18:18 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 655EF6DE0005 for ; Wed, 25 Jan 2017 12:18:18 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id B333D100063 for ; Wed, 25 Jan 2017 22:18:04 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: [PATCH] cli: don't call _entry_in_ignore_list twice in count files debug In-Reply-To: <20161217162843.23773-1-jani@nikula.org> References: <20161217162843.23773-1-jani@nikula.org> User-Agent: Notmuch/0.23.3+85~g2b85e66 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2017 20:18:19 -0000 On Sat, Dec 17 2016, Jani Nikula wrote: > Split file ignores in count_files to fixed and user configured in > order to not have to call _entry_in_ignore_list twice when debugging > is enabled. Minor detail. > --- LGTM. Tomi > notmuch-new.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/notmuch-new.c b/notmuch-new.c > index cc680b412a45..13212639cc8e 100644 > --- a/notmuch-new.c > +++ b/notmuch-new.c > @@ -738,18 +738,20 @@ count_files (const char *path, int *count, add_files_state_t *state) > entry = fs_entries[i]; > > /* Ignore special directories to avoid infinite recursion. > - * Also ignore the .notmuch directory and files/directories > - * the user has configured to be ignored. > + * Also ignore the .notmuch directory. > */ > if (strcmp (entry->d_name, ".") == 0 || > strcmp (entry->d_name, "..") == 0 || > - strcmp (entry->d_name, ".notmuch") == 0 || > - _entry_in_ignore_list (entry->d_name, state)) > - { > - if (state->debug && _entry_in_ignore_list (entry->d_name, state)) > + strcmp (entry->d_name, ".notmuch") == 0) > + continue; > + > + /* Ignore any files/directories the user has configured to be > + * ignored > + */ > + if (_entry_in_ignore_list (entry->d_name, state)) { > + if (state->debug) > printf ("(D) count_files: explicitly ignoring %s/%s\n", > - path, > - entry->d_name); > + path, entry->d_name); > continue; > } > > -- > 2.10.2 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch