From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.7 required=3.0 tests=AWL,BAYES_00, RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_ZBI,RCVD_IN_XBL,RDNS_NONE,SPF_FAIL, SPF_HELO_FAIL shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from 80x24.org (unknown [85.248.227.165]) by dcvr.yhbt.net (Postfix) with ESMTP id A1F11204A0 for ; Sat, 17 Dec 2016 11:53:36 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] searchmsg: do not memoize {date} field Date: Sat, 17 Dec 2016 11:53:24 +0000 Message-Id: <20161217115324.27937-3-e@80x24.org> In-Reply-To: <20161217115324.27937-1-e@80x24.org> References: <20161217115324.27937-1-e@80x24.org> List-Id: We only generate the ->date once in NNTP, so creating the hash entry is a waste. --- lib/PublicInbox/SearchMsg.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm index 57fec16..9f3e27f 100644 --- a/lib/PublicInbox/SearchMsg.pm +++ b/lib/PublicInbox/SearchMsg.pm @@ -77,13 +77,10 @@ my @MoY = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); sub date ($) { my ($self) = @_; - my $date = __hdr($self, 'date'); - return $date if defined $date; my $ts = $self->{ts}; return unless defined $ts; my ($sec, $min, $hour, $mday, $mon, $year, $wday) = gmtime($ts); - $self->{date} = "$DoW[$wday], ". - sprintf("%02d $MoY[$mon] %04d %02d:%02d:%02d +0000", + "$DoW[$wday], " . sprintf("%02d $MoY[$mon] %04d %02d:%02d:%02d +0000", $mday, $year+1900, $hour, $min, $sec); } -- EW