From 34cf1a0ba74e7c0be64691785662ce0b2664d3e0 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Wed, 5 Feb 2014 17:51:52 +1100 Subject: [PATCH] Prevent duplicate PMNS names (related to issue #19). --- include/pcp-cpp/pmda.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/pcp-cpp/pmda.hpp b/include/pcp-cpp/pmda.hpp index 61d10f6..707c11f 100644 --- a/include/pcp-cpp/pmda.hpp +++ b/include/pcp-cpp/pmda.hpp @@ -891,7 +891,11 @@ class pmda { << cluster_iter->first << std::endl; } } else { - stream << " " << cluster_name << std::endl; + static std::string previous_cluster_name; + if (cluster_name != previous_cluster_name) { + stream << " " << cluster_name << std::endl; + previous_cluster_name = cluster_name; + } } } stream << '}' << std::endl;