fixed performance issues, found by selfcheck with cppcheck.

This commit is contained in:
Ettl Martin 2011-03-22 23:15:15 +01:00
parent ff1de4c896
commit 8308fb72e3
2 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ unsigned int CppCheck::check()
std::list<std::string> configurations;
std::string filedata = "";
if (_fileContents.size() > 0 && _fileContents.find(_filenames[c]) != _fileContents.end())
if ( (!_fileContents.empty()) && (_fileContents.find(_filenames[c]) != _fileContents.end()))
{
// File content was given as a string
std::istringstream iss(_fileContents[ _filenames[c] ]);

View File

@ -41,7 +41,7 @@ private:
std::vector<std::string> relative, absolute;
FileLister::recursiveAddFiles2(relative, absolute, ".");
ASSERT(relative.size() != 0);
ASSERT(!relative.empty());
ASSERT_EQUALS((int)relative.size(), (int)absolute.size());
for (std::vector<std::string>::const_iterator r = relative.begin(), r_end = relative.end(),