From b08880f20f235480be7d6714005df4a0242c69cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 2 Jan 2014 17:28:24 +0100 Subject: [PATCH] Library: Changed ignorefunction to a set --- lib/library.cpp | 2 +- lib/library.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/library.cpp b/lib/library.cpp index 0e7496f4d..557acc8d5 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -179,7 +179,7 @@ bool Library::load(const tinyxml2::XMLDocument &doc) argumentChecks[name][nr].strz = strz; argumentChecks[name][nr].valid = valid; } else if (strcmp(functionnode->Name(), "ignorefunction") == 0) { - _ignorefunction[name] = (strcmp(functionnode->GetText(), "true") == 0); + _ignorefunction.insert(name); } else return false; } diff --git a/lib/library.h b/lib/library.h index ce74c1054..9b9ae98ba 100644 --- a/lib/library.h +++ b/lib/library.h @@ -159,8 +159,7 @@ public: } bool ignorefunction(const std::string &function) const { - const std::map::const_iterator it = _ignorefunction.find(function); - return (it != _ignorefunction.end() && it->second); + return (_ignorefunction.find(function) != _ignorefunction.end()); } bool isexecutableblock(const std::string &file, const std::string &token) const { @@ -308,7 +307,7 @@ private: std::map _alloc; // allocation functions std::map _dealloc; // deallocation functions std::map _noreturn; // is function noreturn? - std::map _ignorefunction; // ignore functions/macros from a library (gtk, qt etc) + std::set _ignorefunction; // ignore functions/macros from a library (gtk, qt etc) std::map _reporterrors; std::set _markupExtensions; // file extensions of markup files std::map > _keywords; // keywords for code in the library