From f68a147ff410e216aa9cdba0a6621bd69ff773f8 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 8 Aug 2019 11:42:45 +0100 Subject: [PATCH] don't log identical error messages --- include/mapnik/svg/svg_parser.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/mapnik/svg/svg_parser.hpp b/include/mapnik/svg/svg_parser.hpp index c1931bcdd..0f21c8c72 100644 --- a/include/mapnik/svg/svg_parser.hpp +++ b/include/mapnik/svg/svg_parser.hpp @@ -32,6 +32,7 @@ #include // stl #include +#include namespace boost { namespace property_tree { namespace detail { namespace rapidxml { template class xml_node; @@ -49,7 +50,14 @@ public: void on_error(std::string const& msg) { if (strict_) throw std::runtime_error(msg); - else error_messages_.push_back(msg); + else + { + // avoid duplicate messages + if (std::find(std::begin(error_messages_),std::end(error_messages_), msg) == std::end(error_messages_)) + { + error_messages_.push_back(msg); + } + } } error_message_container const& error_messages() const {