]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Avoid running code when there is no activity (Bazerka)
authorIsaacG <redacted>
Thu, 26 May 2011 22:18:27 +0000 (18:18 -0400)
committerbw1 <redacted>
Mon, 8 Jan 2018 18:23:33 +0000 (19:23 +0100)
scripts/ack.pl

index eb2caa3d945570b6c1fcf580b04cfb12c924acbd..72883d5e6af82d91d4e6eb5f424176528495adcb 100644 (file)
@@ -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');
git clone https://git.99rst.org/PROJECT