From f4ae902794c20dd19bad9446855743ad8d42edf2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 21 Sep 2015 11:11:07 +0000 Subject: 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. --- lib/PublicInbox/Msgmap.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Msgmap.pm') 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; -- cgit v1.2.3-24-ge0c7