2020
2121#include < cinttypes>
2222#include < cstdio>
23+ #include < utility>
2324
2425namespace SST {
2526
26- ComponentInfo::ComponentInfo (ComponentId_t id, const std::string& name) :
27+ ComponentInfo::ComponentInfo (ComponentId_t id, std::string name) :
2728 id_ (id),
2829 parent_info (nullptr ),
29- name (name),
30+ name (std::move( name) ),
3031 type (" " ),
3132 link_map (nullptr ),
3233 component (nullptr ),
@@ -81,12 +82,12 @@ ComponentInfo::ComponentInfo() :
8182// }
8283
8384// Constructor used for Anonymous SubComponents
84- ComponentInfo::ComponentInfo (ComponentId_t id, ComponentInfo* parent_info, const std::string& type,
85- const std::string& slot_name, int slot_num, uint64_t share_flags /* , const Params& params_in*/ ) :
85+ ComponentInfo::ComponentInfo (ComponentId_t id, ComponentInfo* parent_info, std::string type, std::string slot_name ,
86+ int slot_num, uint64_t share_flags /* , const Params& params_in*/ ) :
8687 id_ (id),
8788 parent_info (parent_info),
8889 name (" " ),
89- type (type),
90+ type (std::move( type) ),
9091 link_map (nullptr ),
9192 component (nullptr ),
9293 params (/* new Params()*/ nullptr ),
@@ -97,7 +98,7 @@ ComponentInfo::ComponentInfo(ComponentId_t id, ComponentInfo* parent_info, const
9798 statLoadLevel (0 ),
9899 coordinates (parent_info->coordinates),
99100 subIDIndex (1 ),
100- slot_name (slot_name),
101+ slot_name (std::move( slot_name) ),
101102 slot_num (slot_num),
102103 share_flags (share_flags)
103104{
@@ -387,11 +388,10 @@ ComponentInfo::hasLinks() const
387388
388389// // Functions for testing serialization
389390
390- ComponentInfo::ComponentInfo (
391- ComponentId_t id, const std::string& name, const std::string& slot_name, TimeConverter tv) :
391+ ComponentInfo::ComponentInfo (ComponentId_t id, std::string name, std::string slot_name, TimeConverter tv) :
392392 id_ (id),
393393 parent_info (nullptr ),
394- name (name),
394+ name (std::move( name) ),
395395 type (" " ),
396396 link_map (nullptr ),
397397 component (nullptr ),
@@ -403,7 +403,7 @@ ComponentInfo::ComponentInfo(
403403 all_stat_config_ (nullptr ),
404404 coordinates (3 , 0.0 ),
405405 subIDIndex (1 ),
406- slot_name (slot_name),
406+ slot_name (std::move( slot_name) ),
407407 slot_num (-1 ),
408408 share_flags (0 )
409409{}
0 commit comments