From 8f0390dfa6d66ed322f6d4ad2306353c1669bfac Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 1 Jun 2018 01:23:55 +0300 Subject: Remove redundant assertion in path_match(path, path, dir_path) --- libbutl/filesystem.cxx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'libbutl/filesystem.cxx') diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx index 1ea4cf8..0e1cda5 100644 --- a/libbutl/filesystem.cxx +++ b/libbutl/filesystem.cxx @@ -2126,21 +2126,13 @@ namespace butl auto match = [&entry, &r] (path&& p, const std::string&, bool interim) { - if (p == entry) + // If we found the entry (possibly through one of the recursive + // components) no need to search further. + // + if (p == entry && !interim) { - // If we found the entry (possibly through one of the recursive - // components) no need to search further. - // - if (!interim) - { - r = true; - return false; - } - else - // For self-matching the callback is first called in the interim - // mode (through the preopen function) with an empty path. - // - assert (p.empty ()); + r = true; + return false; } return true; -- cgit v1.1