From 9b8d9f730340ea9d548ab18df45d892c5a2dfdde Mon Sep 17 00:00:00 2001 From: Maik Fischer Date: Wed, 23 Nov 2011 13:34:58 +0100 Subject: [PATCH] i3test.pm: open_(floating_)window: take arguments as hashref or key-value list --- testcases/lib/i3test.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/testcases/lib/i3test.pm b/testcases/lib/i3test.pm index 0f2f2e07..f8ad4e2f 100644 --- a/testcases/lib/i3test.pm +++ b/testcases/lib/i3test.pm @@ -152,8 +152,7 @@ sub wait_for_unmap { # name => 'Window ' # sub open_window { - my ($args) = @_; - my %args = ($args ? %$args : ()); + my %args = @_ == 1 ? %{$_[0]} : @_; my $dont_map = delete $args{dont_map}; @@ -175,8 +174,7 @@ sub open_window { # Thin wrapper around open_window which sets window_type to # _NET_WM_WINDOW_TYPE_UTILITY to make the window floating. sub open_floating_window { - my ($args) = @_; - my %args = ($args ? %$args : ()); + my %args = @_ == 1 ? %{$_[0]} : @_; $args{window_type} = $x->atom(name => '_NET_WM_WINDOW_TYPE_UTILITY');