This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=9fc12b744cdb249ea02ddfbea7bc5d8fad822b97

commit 9fc12b744cdb249ea02ddfbea7bc5d8fad822b97
Author: Guillem Jover <[email protected]>
AuthorDate: Sun Mar 19 04:26:13 2023 +0100

    scripts: Switch code to use chained comparisons
    
    Since perl 5.32 we can use chained comparisons, which should make these
    operations more obvious and compact.
---
 scripts/Dpkg/Changelog.pm    | 2 +-
 scripts/dpkg-scanpackages.pl | 2 +-
 scripts/dpkg-scansources.pl  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/Dpkg/Changelog.pm b/scripts/Dpkg/Changelog.pm
index 8ac81d336..7e9297d2c 100644
--- a/scripts/Dpkg/Changelog.pm
+++ b/scripts/Dpkg/Changelog.pm
@@ -438,7 +438,7 @@ sub abort_early {
        }
        my $start = my $end = $offset;
        $end += $count-1 if $count > 0;
-       return ($start < @$data and $end < @$data);
+        return $start < @{$data} > $end;
     }
 
     return unless defined($r->{since}) or defined($r->{from});
diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl
index 2fa6e53bb..2b2296d63 100755
--- a/scripts/dpkg-scanpackages.pl
+++ b/scripts/dpkg-scanpackages.pl
@@ -220,7 +220,7 @@ sub process_deb {
     GetOptions(\%options, @options_spec);
 }
 
-if (not (@ARGV >= 1 and @ARGV <= 3)) {
+if (not 1 <= @ARGV <= 3) {
     usageerr(g_('one to three arguments expected'));
 }
 
diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl
index 7832efba3..c4bd5df5d 100755
--- a/scripts/dpkg-scansources.pl
+++ b/scripts/dpkg-scansources.pl
@@ -287,7 +287,7 @@ sub process_dsc {
 }
 
 usageerr(g_('one to three arguments expected'))
-    if @ARGV < 1 or @ARGV > 3;
+    if not 1 <= @ARGV <= 3;
 
 push @ARGV, undef if @ARGV < 2;
 push @ARGV, '' if @ARGV < 3;

-- 
Dpkg.Org's dpkg

Reply via email to