(diff_two_paths): minor optimization: exit loop ASAP.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2017-06-09 08:51:24 +03:00
parent 02effb2499
commit 72056890a7
1 changed files with 5 additions and 2 deletions

View File

@ -1030,9 +1030,12 @@ diff_two_paths (const vfs_path_t * vpath1, const vfs_path_t * vpath2)
char *r, *s;
r = strchr (p, PATH_SEP);
s = strchr (q, PATH_SEP);
if (r == NULL || s == NULL)
if (r == NULL)
break;
s = strchr (q, PATH_SEP);
if (s == NULL)
break;
*r = '\0';
*s = '\0';
if (strcmp (p, q) != 0)