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())
|
if (!filenames.empty())
|
||||||
{
|
{
|
||||||
PathMatch matcher(parser.GetIgnoredPaths());
|
PathMatch matcher(parser.GetIgnoredPaths());
|
||||||
// Ignore files
|
std::vector<std::string>::iterator iterBegin = filenames.begin();
|
||||||
std::vector<std::string>::iterator iter = filenames.end();
|
for (int i = (int)filenames.size() - 1; i >= 0; i--)
|
||||||
do
|
|
||||||
{
|
{
|
||||||
--iter;
|
if (matcher.Match(filenames[i]))
|
||||||
if (matcher.Match(*iter))
|
filenames.erase(iterBegin + i);
|
||||||
filenames.erase(iter);
|
|
||||||
}
|
}
|
||||||
while (iter != filenames.begin());
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue