From 0ad9451169c75855e28b49b7c6a51cc85e91d517 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Tr=C3=A1vn=C3=AD=C4=8Dek?= <jan.travnicek@fit.cvut.cz>
Date: Sat, 26 Feb 2022 11:21:56 +0100
Subject: [PATCH] tidy: allow move to have effect

---
 alib2str/src/core/stringApi.cpp | 8 ++++----
 alib2str/src/core/stringApi.hpp | 2 +-
 alib2xml/src/core/xmlApi.cpp    | 8 ++++----
 alib2xml/src/core/xmlApi.hpp    | 2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/alib2str/src/core/stringApi.cpp b/alib2str/src/core/stringApi.cpp
index c931504bdd..605eb1d3d3 100644
--- a/alib2str/src/core/stringApi.cpp
+++ b/alib2str/src/core/stringApi.cpp
@@ -35,12 +35,12 @@ void stringApi < object::Object >::unregisterStringWriter ( const core::type_det
 	}
 }
 
-void stringApi < object::Object >::registerStringWriter ( const core::type_details & type, std::unique_ptr < GroupWriter > entry ) {
-	bool res = composeFunctions ( ).insert ( std::make_pair ( std::move ( type ), std::move ( entry ) ) ).second;
-	if ( ! res ) {
+void stringApi < object::Object >::registerStringWriter ( core::type_details type, std::unique_ptr < GroupWriter > entry ) {
+	auto res = composeFunctions ( ).insert ( std::make_pair ( std::move ( type ), std::move ( entry ) ) );
+	if ( ! res.second ) {
 		std::string groupName = ext::to_string < object::Object > ( );
 
-		throw::exception::CommonException ( "Parse callback of " + ext::to_string ( type ) + " already registered in group " + groupName + "." );
+		throw::exception::CommonException ( "Parse callback of " + ext::to_string ( res.first->first ) + " already registered in group " + groupName + "." );
 	}
 }
 
diff --git a/alib2str/src/core/stringApi.hpp b/alib2str/src/core/stringApi.hpp
index f19e4e4edd..9bca865740 100644
--- a/alib2str/src/core/stringApi.hpp
+++ b/alib2str/src/core/stringApi.hpp
@@ -81,7 +81,7 @@ public:
 		unregisterStringWriter ( core::type_details::get < Type > ( ) );
 	}
 
-	static void registerStringWriter ( const core::type_details & type, std::unique_ptr < GroupWriter > entry );
+	static void registerStringWriter ( core::type_details type, std::unique_ptr < GroupWriter > entry );
 
 	template < class Type >
 	static void registerStringWriter ( ) {
diff --git a/alib2xml/src/core/xmlApi.cpp b/alib2xml/src/core/xmlApi.cpp
index 8fb14a015c..8dff28ff0d 100644
--- a/alib2xml/src/core/xmlApi.cpp
+++ b/alib2xml/src/core/xmlApi.cpp
@@ -39,12 +39,12 @@ void xmlApi < object::Object >::unregisterXmlWriter ( const core::type_details &
 	}
 }
 
-void xmlApi < object::Object >::registerXmlWriter ( const core::type_details & type, std::unique_ptr < GroupComposer > entry ) {
-	bool res = composeFunctions ( ).insert ( std::make_pair ( std::move ( type ), std::move ( entry ) ) ).second;
-	if ( ! res ) {
+void xmlApi < object::Object >::registerXmlWriter ( core::type_details type, std::unique_ptr < GroupComposer > entry ) {
+	auto res = composeFunctions ( ).insert ( std::make_pair ( std::move ( type ), std::move ( entry ) ) );
+	if ( ! res.second ) {
 		std::string groupName = ext::to_string < object::Object > ( );
 
-		throw::exception::CommonException ( "Compose callback of " + ext::to_string ( type ) + " already registered in group " + groupName + "." );
+		throw::exception::CommonException ( "Compose callback of " + ext::to_string ( res.first->first ) + " already registered in group " + groupName + "." );
 	}
 }
 
diff --git a/alib2xml/src/core/xmlApi.hpp b/alib2xml/src/core/xmlApi.hpp
index 6aed490437..7a9db73730 100644
--- a/alib2xml/src/core/xmlApi.hpp
+++ b/alib2xml/src/core/xmlApi.hpp
@@ -116,7 +116,7 @@ public:
 		unregisterXmlWriter ( core::type_details::get < Type > ( ) );
 	}
 
-	static void registerXmlWriter ( const core::type_details & type, std::unique_ptr < GroupComposer > entry );
+	static void registerXmlWriter ( core::type_details type, std::unique_ptr < GroupComposer > entry );
 
 	template < class Type >
 	static void registerXmlWriter ( ) {
-- 
GitLab