From: Eric Wong Date: Mon, 21 Sep 2015 11:11:07 +0000 (+0000) Subject: msgmap: minor cleanup to move constant declaration X-Git-Tag: v1.0.0~855 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f4ae902794c20dd19bad9446855743ad8d42edf2;p=public-inbox.git msgmap: minor cleanup to move constant declaration This doesn't actually change anything as the constant is still usable in other subroutines, but helps with consistency and readability IMHO. --- diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm index 2f64d90c..f2857908 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;