use normal for loop in globmatcher

master
Daniel Kolesa 2015-12-17 01:53:14 +00:00
parent 2e98d0aecd
commit b217bbcd65
1 changed files with 1 additions and 4 deletions

View File

@ -28,8 +28,7 @@ static void ob_get_path_parts(Vector<ConstCharRange> &parts,
static bool ob_path_matches(ConstCharRange fn, static bool ob_path_matches(ConstCharRange fn,
const Vector<ConstCharRange> &parts) { const Vector<ConstCharRange> &parts) {
auto it = parts.iter(); for (auto it = parts.iter(); !it.empty(); ++it) {
while (!it.empty()) {
ConstCharRange elem = it.front(); ConstCharRange elem = it.front();
if (elem == "*") { if (elem == "*") {
++it; ++it;
@ -52,8 +51,6 @@ static bool ob_path_matches(ConstCharRange fn,
if (fn.slice(0, elem.size()) != elem) if (fn.slice(0, elem.size()) != elem)
return false; return false;
fn += elem.size(); fn += elem.size();
/* try next element */
++it;
} }
/* if there are no chars in the fname remaining, we fully matched */ /* if there are no chars in the fname remaining, we fully matched */
return fn.empty(); return fn.empty();