@@ -108,8 +108,10 @@ bool operator==(const Property& lhs, const Property& rhs) {
108108}
109109
110110PropertyGroup::PropertyGroup (const std::vector<Property>& properties,
111- FileType file_type, const std::string& prefix)
112- : properties_(properties), file_type_(file_type), prefix_(prefix) {
111+ FileType file_type, std::string prefix)
112+ : properties_(properties),
113+ file_type_ (file_type),
114+ prefix_(std::move(prefix)) {
113115 if (prefix_.empty () && !properties_.empty ()) {
114116 for (const auto & p : properties_) {
115117 prefix_ += p.name + REGULAR_SEPARATOR;
@@ -182,8 +184,8 @@ bool operator==(const PropertyGroup& lhs, const PropertyGroup& rhs) {
182184}
183185
184186AdjacentList::AdjacentList (AdjListType type, FileType file_type,
185- const std::string& prefix)
186- : type_(type), file_type_(file_type), prefix_(prefix) {
187+ std::string prefix)
188+ : type_(type), file_type_(file_type), prefix_(std::move( prefix) ) {
187189 if (prefix_.empty ()) {
188190 prefix_ = std::string (AdjListTypeToString (type_)) + " /" ;
189191 }
@@ -212,15 +214,15 @@ std::shared_ptr<AdjacentList> CreateAdjacentList(AdjListType type,
212214
213215class VertexInfo ::Impl {
214216 public:
215- Impl (const std::string& type, IdType chunk_size, const std::string& prefix,
217+ Impl (std::string type, IdType chunk_size, std::string prefix,
216218 const PropertyGroupVector& property_groups,
217219 const std::vector<std::string>& labels,
218220 std::shared_ptr<const InfoVersion> version)
219- : type_(type),
221+ : type_(std::move( type) ),
220222 chunk_size_ (chunk_size),
221223 property_groups_(std::move(property_groups)),
222224 labels_(labels),
223- prefix_(prefix),
225+ prefix_(std::move( prefix) ),
224226 version_(std::move(version)) {
225227 if (prefix_.empty ()) {
226228 prefix_ = type_ + " /" ; // default prefix
@@ -568,20 +570,20 @@ Status VertexInfo::Save(const std::string& path) const {
568570
569571class EdgeInfo ::Impl {
570572 public:
571- Impl (const std::string& src_type, const std::string& edge_type,
572- const std::string& dst_type , IdType chunk_size , IdType src_chunk_size ,
573- IdType dst_chunk_size, bool directed, const std::string& prefix,
573+ Impl (std::string src_type, std::string edge_type, std::string dst_type ,
574+ IdType chunk_size , IdType src_chunk_size , IdType dst_chunk_size ,
575+ bool directed, std::string prefix,
574576 const AdjacentListVector& adjacent_lists,
575577 const PropertyGroupVector& property_groups,
576578 std::shared_ptr<const InfoVersion> version)
577- : src_type_(src_type),
578- edge_type_ (edge_type),
579- dst_type_(dst_type),
579+ : src_type_(std::move( src_type) ),
580+ edge_type_ (std::move( edge_type) ),
581+ dst_type_(std::move( dst_type) ),
580582 chunk_size_(chunk_size),
581583 src_chunk_size_(src_chunk_size),
582584 dst_chunk_size_(dst_chunk_size),
583585 directed_(directed),
584- prefix_(prefix),
586+ prefix_(std::move( prefix) ),
585587 adjacent_lists_(std::move(adjacent_lists)),
586588 property_groups_(std::move(property_groups)),
587589 version_(std::move(version)) {
0 commit comments