From a3bde58262d9ac85fce2b7209adafbbca516c68a Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sat, 13 Jun 2015 10:10:37 -1000 Subject: [PATCH] Update Project.cpp --- hecl/lib/database/Project.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hecl/lib/database/Project.cpp b/hecl/lib/database/Project.cpp index 7ee5d99c3..332fcae1d 100644 --- a/hecl/lib/database/Project.cpp +++ b/hecl/lib/database/Project.cpp @@ -95,11 +95,14 @@ void Project::ConfigFile::removeLine(const std::string& refLine) throw HECL::Exception(_S("Project::ConfigFile::lockAndRead not yet called")); for (auto it = m_lines.begin(); - it != m_lines.end(); - ++it) + it != m_lines.end();) { if (!(*it).compare(refLine)) + { it = m_lines.erase(it); + continue; + } + ++it; } } @@ -233,11 +236,14 @@ bool Project::removePaths(const std::vector& paths, bool recursive) { std::string recursiveBase = path.getRelativePathUTF8(); for (auto it = existingPaths.begin(); - it != existingPaths.end(); - ++it) + it != existingPaths.end()) { if (!(*it).compare(0, recursiveBase.size(), recursiveBase)) + { it = existingPaths.erase(it); + continue; + } + ++it; } } }