diff --git a/extractor/restriction_parser.cpp b/extractor/restriction_parser.cpp index dd4855508..7965e78ec 100644 --- a/extractor/restriction_parser.cpp +++ b/extractor/restriction_parser.cpp @@ -39,6 +39,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include + namespace { int lua_error_callback(lua_State *lua_state) @@ -228,14 +230,16 @@ bool RestrictionParser::ShouldIgnoreRestriction(const std::string &except_tag_st // only a few exceptions are actually defined. std::vector exceptions; boost::algorithm::split_regex(exceptions, except_tag_string, boost::regex("[;][ ]*")); - for (std::string ¤t_string : exceptions) - { - const auto string_iterator = - std::find(restriction_exceptions.begin(), restriction_exceptions.end(), current_string); - if (restriction_exceptions.end() != string_iterator) - { - return true; - } - } - return false; + + return std::any_of(std::begin(exceptions), std::end(exceptions), + [&](const std::string ¤t_string) + { + if (restriction_exceptions.end() != + std::find(restriction_exceptions.begin(), + restriction_exceptions.end(), current_string)) + { + return true; + } + return false; + }); }