]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: avoid useless use of strftime
authorEric Wong <e@80x24.org>
Tue, 13 Dec 2016 03:10:12 +0000 (03:10 +0000)
committerEric Wong <e@80x24.org>
Tue, 13 Dec 2016 03:46:35 +0000 (03:46 +0000)
There's no need to use strftime if we'll be converting the date
by hand, anyways.

lib/PublicInbox/NNTP.pm

index b7143ff3ef07db59505e34b3d2176447c398c842..9408ffb9d8540cf4f19fe70ee5301596d95fd807 100644 (file)
@@ -250,8 +250,8 @@ sub parse_time ($$;$) {
                ($YYYY, $MM, $DD) = unpack('A4A2A2', $date);
        } else { # legacy clients send YYMMDD
                ($YYYY, $MM, $DD) = unpack('A2A2A2', $date);
-               if ($YYYY > strftime('%y', @now)) {
-                       my $cur_year = $now[5] + 1900;
+               my $cur_year = $now[5] + 1900;
+               if ($YYYY > $cur_year) {
                        $YYYY += int($cur_year / 1000) * 1000 - 100;
                }
        }