Use different way to remove items from vector.
The way I was using caused a debug error in Visual Studio 2008. Probably because the iterator got invalidated. So access items as array instead.
This commit is contained in:
parent
51a1f64531
commit
1a83e3ef81
|
@ -93,15 +93,12 @@ bool CppCheckExecutor::parseFromArgs(CppCheck *cppcheck, int argc, const char* c
|
|||
if (!filenames.empty())
|
||||
{
|
||||
PathMatch matcher(parser.GetIgnoredPaths());
|
||||
// Ignore files
|
||||
std::vector<std::string>::iterator iter = filenames.end();
|
||||
do
|
||||
std::vector<std::string>::iterator iterBegin = filenames.begin();
|
||||
for (int i = (int)filenames.size() - 1; i >= 0; i--)
|
||||
{
|
||||
--iter;
|
||||
if (matcher.Match(*iter))
|
||||
filenames.erase(iter);
|
||||
if (matcher.Match(filenames[i]))
|
||||
filenames.erase(iterBegin + i);
|
||||
}
|
||||
while (iter != filenames.begin());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue