Return constant reference from SWRaid_Info::get_uuid() (!94)

Since the only use of SWRaid_Info::get_uuid() assign the returned value
this doesn't actually save any copy construction.  Do it for consistency
with the other get_*() methods in SWRaid_Info.

Closes !94 - Make more getter methods use return-by-constant-reference
This commit is contained in:
Mike Fleetwood 2021-11-06 14:00:33 +00:00 committed by Curtis Gedak
parent b38ee9c8ac
commit 0eedfa6030
2 changed files with 3 additions and 2 deletions

View File

@ -60,7 +60,7 @@ public:
static bool is_member_active( const Glib::ustring & member_path );
static FSType get_fstype(const Glib::ustring& member_path);
static const Glib::ustring& get_array(const Glib::ustring& member_path);
static Glib::ustring get_uuid( const Glib::ustring & member_path );
static const Glib::ustring& get_uuid(const Glib::ustring& member_path);
static Glib::ustring get_label( const Glib::ustring & member_path );
private:

View File

@ -93,9 +93,10 @@ const Glib::ustring& SWRaid_Info::get_array(const Glib::ustring& member_path)
return memb.array;
}
// Return array UUID for the specified member, or "" when failed to parse the UUID or
// there is no such member.
Glib::ustring SWRaid_Info::get_uuid( const Glib::ustring & member_path )
const Glib::ustring& SWRaid_Info::get_uuid(const Glib::ustring& member_path)
{
initialise_if_required();
const SWRaid_Member & memb = get_cache_entry_by_member( member_path );