From b41ee3eddec5a911420bad5b3aec4ff35213b36f Mon Sep 17 00:00:00 2001
From: Patrick Dular <patrick.dular@ulg.ac.be>
Date: Mon, 13 Mar 2017 21:01:35 +0000
Subject: [PATCH] Change of Print Struct

---
 Parser/Parser.h | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/Parser/Parser.h b/Parser/Parser.h
index 6f9eae2310..8ca9cf97fa 100644
--- a/Parser/Parser.h
+++ b/Parser/Parser.h
@@ -85,7 +85,7 @@ public:
               const std::string & struct_name, const std::string & struct_namespace)
     const
   {
-    str += "Struct ";
+    str = "Struct ";
     if (struct_namespace.size()) str += struct_namespace + "::";
     str += struct_name + " [ ";
     bool flag_comma = false;
@@ -185,18 +185,11 @@ public:
     return 0; // 0: no error
   }
 
-  void sprint(std::string & str, const std::string & struct_namespace) const
-  {
-    for (Map_string_Struct::const_iterator it_st = this->get().begin();
-         it_st != this->get().end(); ++it_st )
-      it_st->second.sprint(str, it_st->first, struct_namespace);
-  }
   void sprint(std::vector<std::string> & strs_out, const std::string & struct_namespace) const
   {
     std::string str;
     for (Map_string_Struct::const_iterator it_st = this->get().begin();
          it_st != this->get().end(); ++it_st ) {
-      str.clear();
       it_st->second.sprint(str, it_st->first, struct_namespace);
       strs_out.insert(strs_out.end(), str);
     }
@@ -291,17 +284,12 @@ public:
     return (structs_P && struct_P)? struct_P->getMember_ValMax() : -1;
   }
 
-  void sprint(std::string & str) const
-  {
-    for (Map_string_Structs::const_iterator it_ns = this->get().begin();
-         it_ns != this->get().end(); ++it_ns )
-      it_ns->second.sprint(str, it_ns->first);
-  }
   void sprint(std::vector<std::string> & strs_out) const
   {
     std::vector<std::string> strs;
     for (Map_string_Structs::const_iterator it_ns = this->get().begin();
          it_ns != this->get().end(); ++it_ns ) {
+      strs.clear();
       it_ns->second.sprint(strs, it_ns->first);
       strs_out.insert(strs_out.end(), strs.begin(), strs.end());
     }
-- 
GitLab