From 052bd210b1c7af5efd0f0b6938eefcc647a5ea45 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 17 Apr 2023 14:07:18 +0200 Subject: [PATCH] js generator: avoid doing two tests per line combine the checks and make the second dependent from the former Signed-off-by: Thomas Lamprecht --- jsgettext.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jsgettext.pl b/jsgettext.pl index ef2bea9..d2f293e 100755 --- a/jsgettext.pl +++ b/jsgettext.pl @@ -122,8 +122,7 @@ sub extract_msg { foreach my $s (@$sources) { open(my $SRC_FH, '<', $s) || die "unable to open file '$s' - $!\n"; while(defined(my $line = <$SRC_FH>)) { - next if $line =~ m/^\s*function gettext/; - if ($line =~ m/gettext\s*\(/) { + if ($line =~ m/gettext\s*\(/ && $line !~ m/^\s*function gettext/) { extract_msg($s, $., $line); } } -- 2.39.2