From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2F2C220100 for ; Mon, 21 Sep 2015 11:11:15 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/6] msgmap: minor cleanup to move constant declaration Date: Mon, 21 Sep 2015 11:11:07 +0000 Message-Id: <20150921111112.18873-2-e@80x24.org> In-Reply-To: <20150921111112.18873-1-e@80x24.org> References: <20150921111112.18873-1-e@80x24.org> List-Id: This doesn't actually change anything as the constant is still usable in other subroutines, but helps with consistency and readability IMHO. --- lib/PublicInbox/Msgmap.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index 2f64d90..f285790 100644 --- a/lib/PublicInbox/Msgmap.pm +++ b/lib/PublicInbox/Msgmap.pm @@ -84,10 +84,10 @@ sub mid_insert { $dbh->last_insert_id(undef, undef, 'msgmap', 'num'); } -use constant MID_FOR => 'SELECT mid FROM msgmap WHERE num = ? LIMIT 1'; sub mid_for { my ($self, $num) = @_; my $dbh = $self->{dbh}; + use constant MID_FOR => 'SELECT mid FROM msgmap WHERE num = ? LIMIT 1'; my $sth = $self->{mid_for} ||= $dbh->prepare(MID_FOR); $sth->bind_param(1, $num); $sth->execute; -- EW