simple optimisation

This commit is contained in:
Daniel Marjamäki 2009-10-27 17:55:27 +01:00
parent 0fc86924c6
commit aab1519ab0
2 changed files with 5 additions and 4 deletions

View File

@ -54,7 +54,7 @@ void Settings::autoDealloc(std::istream &istr)
continue;
// Add classname to list
_autoDealloc.push_back(line);
_autoDealloc.insert(line);
}
}
@ -116,12 +116,12 @@ bool Settings::isSuppressed(const std::string &errorId, const std::string &file,
void Settings::addAutoAllocClass(const std::string &name)
{
_autoDealloc.push_back(name);
_autoDealloc.insert(name);
}
bool Settings::isAutoDealloc(const char classname[]) const
{
return (std::find(_autoDealloc.begin(), _autoDealloc.end(), classname) != _autoDealloc.end());
return (_autoDealloc.find(classname) != _autoDealloc.end());
}

View File

@ -23,6 +23,7 @@
#include <string>
#include <istream>
#include <map>
#include <set>
/// @addtogroup Core
/// @{
@ -37,7 +38,7 @@ class Settings
{
private:
/** classes that are automaticly deallocated */
std::list<std::string> _autoDealloc;
std::set<std::string> _autoDealloc;
/** Code to append in the checks */
std::string _append;