#include "blacklist.hpp" #include #include #include #include #include bool CSMDoc::Blacklist::isBlacklisted(const CSMWorld::UniversalId& id) const { std::map>::const_iterator iter = mIds.find(id.getType()); if (iter == mIds.end()) return false; return std::binary_search(iter->second.begin(), iter->second.end(), Misc::StringUtils::lowerCase(id.getId())); } void CSMDoc::Blacklist::add(CSMWorld::UniversalId::Type type, const std::vector& ids) { std::vector& list = mIds[type]; size_t size = list.size(); list.resize(size + ids.size()); std::transform(ids.begin(), ids.end(), list.begin() + size, [](const std::string& s) { return Misc::StringUtils::lowerCase(s); }); std::sort(list.begin(), list.end()); }