Use constant reference from LVM2_PV_Info::get_vg_cache_entry_by_name() (!94)

Closes !94 - Make more getter methods use return-by-constant-reference
This commit is contained in:
Mike Fleetwood 2021-11-02 21:26:41 +00:00 committed by Curtis Gedak
parent c35422a70c
commit 81f5dc3ead
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ bool LVM2_PV_Info::has_active_lvs( const Glib::ustring & path )
bool LVM2_PV_Info::is_vg_exported( const Glib::ustring & vgname )
{
initialize_if_required() ;
LVM2_VG vg = get_vg_cache_entry_by_name( vgname );
const LVM2_VG& vg = get_vg_cache_entry_by_name(vgname);
return bit_set( vg.vg_attr, VGBIT_EXPORTED );
}
@ -191,7 +191,7 @@ std::vector<Glib::ustring> LVM2_PV_Info::get_error_messages( const Glib::ustring
//Check for partition specific message: partial VG
const LVM2_PV& pv = get_pv_cache_entry_by_name(path);
LVM2_VG vg = get_vg_cache_entry_by_name( pv.vg_name );
const LVM2_VG& vg = get_vg_cache_entry_by_name(pv.vg_name);
if ( bit_set( vg.vg_attr, VGBIT_PARTIAL ) )
{
temp = _("One or more Physical Volumes belonging to the Volume Group is missing.") ;