about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-09-21 11:11:07 +0000
committerEric Wong <e@80x24.org>2015-09-21 11:37:01 +0000
commitf4ae902794c20dd19bad9446855743ad8d42edf2 (patch)
tree1c856862f9bb5cc01641e6097698e339ed62a1ac /lib/PublicInbox/Msgmap.pm
parentcb2d1876d776ae6b8ec1d172f1f64169fe1efd5c (diff)
downloadpublic-inbox-f4ae902794c20dd19bad9446855743ad8d42edf2.tar.gz
This doesn't actually change anything as the constant is still
usable in other subroutines, but helps with consistency and
readability IMHO.
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm2
1 files changed, 1 insertions, 1 deletions
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;