diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-06-26 11:02:05 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-06-26 11:02:05 +0000 |
commit | ec4f620b1582385d94e6c9b0ed4311136bdf17f6 (patch) | |
tree | 772c2b0cb86d4f79f962de3afd7c3bf38884e01c | |
parent | 9a6acf6c2be15865ff3112981135852e180ef738 (diff) | |
download | mgaadvisories-ec4f620b1582385d94e6c9b0ed4311136bdf17f6.tar mgaadvisories-ec4f620b1582385d94e6c9b0ed4311136bdf17f6.tar.gz mgaadvisories-ec4f620b1582385d94e6c9b0ed4311136bdf17f6.tar.bz2 mgaadvisories-ec4f620b1582385d94e6c9b0ed4311136bdf17f6.tar.xz mgaadvisories-ec4f620b1582385d94e6c9b0ed4311136bdf17f6.zip |
Split long line
-rw-r--r-- | lib/MGA/Advisories.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm index 64c128c..b9e3efc 100644 --- a/lib/MGA/Advisories.pm +++ b/lib/MGA/Advisories.pm @@ -77,7 +77,8 @@ sub get_advisories_from_dir { sub next_id { my $prefix = shift; my $year = DateTime->now->year; - my $newid = (0, sort { $a <=> $b } map { m/^$prefix-$year-(\d+)$/ ? int $1 : () } @_)[-1] + 1; + my @used_ids = map { m/^$prefix-$year-(\d+)$/ ? int $1 : () } @_; + my $newid = (0, sort { $a <=> $b } @used_ids)[-1] + 1; return sprintf("%s-%s-%.4d", $prefix, $year, $newid); } |