From 420c955df668cedf988f85657fbf1342240d5e21 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Wed, 23 Aug 2017 15:31:50 +0200
Subject: [PATCH] add const ref in compose argument

---
 alib2common/src/primitive/String.cpp | 4 ++--
 alib2common/src/primitive/String.h   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/alib2common/src/primitive/String.cpp b/alib2common/src/primitive/String.cpp
index 4733ae5d8f..cac9c55b72 100644
--- a/alib2common/src/primitive/String.cpp
+++ b/alib2common/src/primitive/String.cpp
@@ -68,7 +68,7 @@ void String::compose(ext::deque<sax::Token>& out) const {
 	compose(out, this->getData());
 }
 
-void String::compose(ext::deque<sax::Token>& out, std::string primitive) {
+void String::compose(ext::deque<sax::Token>& out, const std::string & primitive) {
 	out.emplace_back(primitive::String::getXmlTagName(), sax::Token::TokenType::START_ELEMENT);
 	out.emplace_back(primitive, sax::Token::TokenType::CHARACTER);
 	out.emplace_back(primitive::String::getXmlTagName(), sax::Token::TokenType::END_ELEMENT);
@@ -95,7 +95,7 @@ std::string xmlApi<std::string>::xmlTagName() {
 	return primitive::String::getXmlTagName();
 }
 
-void xmlApi<std::string>::compose(ext::deque<sax::Token>& output, std::string data) {
+void xmlApi<std::string>::compose(ext::deque<sax::Token>& output, const std::string & data) {
 	primitive::String::compose(output, data);
 }
 
diff --git a/alib2common/src/primitive/String.h b/alib2common/src/primitive/String.h
index 06a188734e..87f7a52d5b 100644
--- a/alib2common/src/primitive/String.h
+++ b/alib2common/src/primitive/String.h
@@ -66,7 +66,7 @@ public:
 	static std::string parseRaw ( ext::deque < sax::Token >::iterator & input );
 
 	void compose ( ext::deque < sax::Token > & out ) const;
-	static void compose ( ext::deque < sax::Token > & out, std::string primitive );
+	static void compose ( ext::deque < sax::Token > & out, const std::string & primitive );
 
 	virtual PrimitiveBase * inc ( ) &&;
 
@@ -86,7 +86,7 @@ struct xmlApi < std::string > {
 	static std::string parse ( ext::deque < sax::Token >::iterator & input );
 	static bool first ( const ext::deque < sax::Token >::const_iterator & input );
 	static std::string xmlTagName ( );
-	static void compose ( ext::deque < sax::Token > & output, std::string data );
+	static void compose ( ext::deque < sax::Token > & output, const std::string & data );
 };
 
 } /* namespace alib */
-- 
GitLab