From: IsaacG Date: Thu, 26 May 2011 22:18:27 +0000 (-0400) Subject: Avoid running code when there is no activity (Bazerka) X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=8724657e3ec59ef5513f49a01025de6ba3ca700b;p=irssi-scripts.irssi.org.git Avoid running code when there is no activity (Bazerka) --- diff --git a/scripts/ack.pl b/scripts/ack.pl index eb2caa3..72883d5 100644 --- a/scripts/ack.pl +++ b/scripts/ack.pl @@ -133,7 +133,8 @@ sub cmd_ack # The sorts can also be reversed with a - flag or normal with a + flag # Each sort function takes a list of windows and returns another list of equal or smaller size - my @windows = grep { $_->{data_level} } Irssi::windows(); # Must have some activity. + my @windows = grep { $_->{data_level} } Irssi::windows(); # Get windows with activity + return unless @windows; # Prevent a bunch of function calls when there's no active windows # The sort functions to use my $ack_sorts = Irssi::settings_get_str('ack_sorts');