]> git.proxmox.com Git - proxmox-i18n.git/commitdiff
js generator: avoid doing two tests per line
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 17 Apr 2023 12:07:18 +0000 (14:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 17 Apr 2023 12:12:31 +0000 (14:12 +0200)
combine the checks and make the second dependent from the former

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
jsgettext.pl

index ef2bea9316b77918e99e640cf79c11f753b0f914..d2f293e23dc40c13c3b3c15eff981fc14c818f67 100755 (executable)
@@ -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);
        }
     }