Skip to content
Snippets Groups Projects
Commit 0ad94511 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

tidy: allow move to have effect

parent 87ffb274
No related branches found
No related tags found
1 merge request!224Tidy fixes following the merger of new normalization
Pipeline #179284 passed with warnings
......@@ -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 + "." );
}
}
 
......
......@@ -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 ( ) {
......
......@@ -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 + "." );
}
}
 
......
......@@ -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 ( ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment