[gparted] Use constant reference from LVM2_PV_Info::get_vg_cache_entry_by_name() (!94)



commit 81f5dc3ead6febd5896f4c3b95de2393e1ba80dc
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Tue Nov 2 21:26:41 2021 +0000

    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

 src/LVM2_PV_Info.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/LVM2_PV_Info.cc b/src/LVM2_PV_Info.cc
index 204901d2..d8eefda6 100644
--- a/src/LVM2_PV_Info.cc
+++ b/src/LVM2_PV_Info.cc
@@ -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.") ;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]