[pmg-devel] applied: [PATCH] RuleDB: load_object: do explicit return
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Oct 8 08:21:19 CEST 2019
While perl5 returns the result of the last expression implicitly, if
no explicit return statement is in a submethod's code path, it's much
nicer to do the things explicit most of the times, and a slight
modification could even break this.
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
src/PMG/RuleDB.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PMG/RuleDB.pm b/src/PMG/RuleDB.pm
index 542fd4a..9b8abd0 100644
--- a/src/PMG/RuleDB.pm
+++ b/src/PMG/RuleDB.pm
@@ -436,7 +436,7 @@ sub load_object {
my $otype = $ref->{'objecttype'};
my $obj = $self->get_object($otype);
- $obj->load_attr($self, $objid, $ogroup, $value);
+ return $obj->load_attr($self, $objid, $ogroup, $value);
}
sub load_object_full {
--
2.20.1
More information about the pmg-devel
mailing list