[PATCH] HVTarget: trivial NFC code cleanup
--- lib/Sys/VirtV2V/HVTarget/Linux.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Sys/VirtV2V/HVTarget/Linux.pm b/lib/Sys/VirtV2V/HVTarget/Linux.pm index 53784ea..dc546de 100644 --- a/lib/Sys/VirtV2V/HVTarget/Linux.pm +++ b/lib/Sys/VirtV2V/HVTarget/Linux.pm @@ -349,7 +349,7 @@ sub _configure_kernel } # If we didn't install a new kernel, pick the default kernel - $boot_kernel = $guestos->get_default_kernel() if(!defined($boot_kernel)); + $boot_kernel ||= $guestos->get_default_kernel(); return $boot_kernel; } -- 1.6.5.2
On Wed, Dec 16, 2009 at 03:04:09PM +0000, Matthew Booth wrote:
--- lib/Sys/VirtV2V/HVTarget/Linux.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Sys/VirtV2V/HVTarget/Linux.pm b/lib/Sys/VirtV2V/HVTarget/Linux.pm index 53784ea..dc546de 100644 --- a/lib/Sys/VirtV2V/HVTarget/Linux.pm +++ b/lib/Sys/VirtV2V/HVTarget/Linux.pm @@ -349,7 +349,7 @@ sub _configure_kernel }
# If we didn't install a new kernel, pick the default kernel - $boot_kernel = $guestos->get_default_kernel() if(!defined($boot_kernel)); + $boot_kernel ||= $guestos->get_default_kernel();
return $boot_kernel; } -- 1.6.5.2
Yes, should be the same in Perl. Unless $boot_kernel could ever be the literal string "0" ... ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://et.redhat.com/~rjones/libguestfs/ See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
On 16/12/09 15:07, Richard W.M. Jones wrote:
On Wed, Dec 16, 2009 at 03:04:09PM +0000, Matthew Booth wrote:
--- lib/Sys/VirtV2V/HVTarget/Linux.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Sys/VirtV2V/HVTarget/Linux.pm b/lib/Sys/VirtV2V/HVTarget/Linux.pm index 53784ea..dc546de 100644 --- a/lib/Sys/VirtV2V/HVTarget/Linux.pm +++ b/lib/Sys/VirtV2V/HVTarget/Linux.pm @@ -349,7 +349,7 @@ sub _configure_kernel }
# If we didn't install a new kernel, pick the default kernel - $boot_kernel = $guestos->get_default_kernel() if(!defined($boot_kernel)); + $boot_kernel ||= $guestos->get_default_kernel();
return $boot_kernel; } -- 1.6.5.2
Yes, should be the same in Perl. Unless $boot_kernel could ever be the literal string "0" ...
ACK.
Rich.
Thanks, both pushed. Matt -- Matthew Booth, RHCA, RHCSS Red Hat Engineering, Virtualisation Team M: +44 (0)7977 267231 GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
participants (2)
-
Matthew Booth -
Richard W.M. Jones