diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-19 11:32:41 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-10-19 16:56:47 -0700 |
commit | 719f5b869d21794aeaab6101ed62242626e95f52 (patch) | |
tree | 65eaccb4db4657b766676bde0f297993edc2ad31 | |
parent | d95bc26cd3686d345136b34462cc77b591b459ba (diff) |
Reduce number of strcmp calls to check directory names for revision control
Group directory names to match depending on whether they start
with a "." or not, when not using -withrevinfo.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | lndir.c | 37 |
1 files changed, 20 insertions, 17 deletions
@@ -200,23 +200,26 @@ dodir (const char *fn, /* name of "from" directory, either absolute or dp->d_name[2] == '\0'))) continue; if (!with_revinfo) { - if (!strcmp (dp->d_name, ".git")) - continue; - if (!strcmp (dp->d_name, ".hg")) - continue; - if (!strcmp (dp->d_name, "BitKeeper")) - continue; - if (!strcmp (dp->d_name, "RCS")) - continue; - if (!strcmp (dp->d_name, "SCCS")) - continue; - if (!strcmp (dp->d_name, "CVS")) - continue; - if (!strcmp (dp->d_name, "CVS.adm")) - continue; - if (!strcmp (dp->d_name, ".svn")) - continue; - } + if (dp->d_name[0] == '.') { + if (!strcmp (dp->d_name, ".git")) + continue; + if (!strcmp (dp->d_name, ".hg")) + continue; + if (!strcmp (dp->d_name, ".svn")) + continue; + } else { + if (!strcmp (dp->d_name, "BitKeeper")) + continue; + if (!strcmp (dp->d_name, "RCS")) + continue; + if (!strcmp (dp->d_name, "SCCS")) + continue; + if (!strcmp (dp->d_name, "CVS")) + continue; + if (!strcmp (dp->d_name, "CVS.adm")) + continue; + } + } ocurdir = rcurdir; rcurdir = buf; curdir = silent ? buf : (char *)0; |