Skip to content

Commit 7d30a22

Browse files
committed
Use std::string_view instead of const std::string&
1 parent f474dcc commit 7d30a22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ario/ario.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ario
112112
operator std::string() const { return name; }
113113
operator std::string_view() const { return name; }
114114
operator const char*() const { return name.c_str(); }
115-
bool operator==( const std::string& name ) const
115+
bool operator==( std::string_view name ) const
116116
{
117117
return this->name == name;
118118
}
@@ -123,7 +123,7 @@ class ario
123123
this->pstream = pstream;
124124
}
125125

126-
void set_new_data( const std::string& data ) { this->new_data = data; }
126+
void set_new_data( std::string_view data ) { this->new_data = data; }
127127

128128
protected:
129129
std::string short_name = {}; ///< Short name of the member
@@ -235,7 +235,7 @@ class ario
235235

236236
//------------------------------------------------------------------------------
237237
//! @brief Constructor
238-
explicit ario() : members( this ){};
238+
explicit ario() : members( this ) {};
239239
ario( const ario& ) = delete;
240240
ario& operator=( const ario& ) = delete;
241241
ario( ario&& ) = delete;
@@ -411,7 +411,7 @@ class ario
411411
//! @param member The member to add
412412
//! @param data The data associated with the member
413413
//! @return Error object indicating success or failure
414-
Result add_member( const Member& member, const std::string& data )
414+
Result add_member( const Member& member, std::string_view data )
415415
{
416416
// Don't allow empty member names
417417
if ( member.name.empty() ) {

0 commit comments

Comments
 (0)