git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2f3a0e3
)
Cleanup initialisation of hash entries in Lib.pm
author
Matthew Booth
<mbooth@redhat.com>
Wed, 19 Aug 2009 14:51:27 +0000
(15:51 +0100)
committer
Matthew Booth
<mbooth@redhat.com>
Wed, 19 Aug 2009 14:52:10 +0000
(15:52 +0100)
perl/lib/Sys/Guestfs/Lib.pm
patch
|
blob
|
history
diff --git
a/perl/lib/Sys/Guestfs/Lib.pm
b/perl/lib/Sys/Guestfs/Lib.pm
index
dfa79af
..
96ada0d
100644
(file)
--- a/
perl/lib/Sys/Guestfs/Lib.pm
+++ b/
perl/lib/Sys/Guestfs/Lib.pm
@@
-1558,12
+1558,8
@@
sub _check_for_kernels
# Check the kernel was recognised
if(defined($kernel)) {
# Put this kernel on the top level kernel list
# Check the kernel was recognised
if(defined($kernel)) {
# Put this kernel on the top level kernel list
- my $kernels = $os->{kernels};
- if(!defined($kernels)) {
- $kernels = [];
- $os->{kernels} = $kernels;
- }
- push(@$kernels, $kernel);
+ $os->{kernels} ||= [];
+ push(@{$os->{kernels}}, $kernel);
$config{kernel} = $kernel;
$config{kernel} = $kernel;
@@
-1766,13
+1762,8
@@
sub _inspect_initrd
}
# Add to the top level initrd_modules entry
}
# Add to the top level initrd_modules entry
- my $initrd_modules = $os->{initrd_modules};
- if(!defined($initrd_modules)) {
- $initrd_modules = {};
- $os->{initrd_modules} = $initrd_modules;
- }
-
- $initrd_modules->{$version} = \@modules;
+ $os->{initrd_modules} ||= {};
+ $os->{initrd_modules}->{$version} = \@modules;
return \@modules;
}
return \@modules;
}