]> git.donarmstrong.com Git - infobot.git/commitdiff
save 2 lookups while I'm at it
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 1 Nov 2002 21:09:14 +0000 (21:09 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 1 Nov 2002 21:09:14 +0000 (21:09 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@582 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Reply.pl

index 88bc854069ea5b7c0dd3b8d6678b3ec708b75dc6..0d518658fccd6b62e8cf4c9a6921412f9db693ef 100644 (file)
@@ -28,7 +28,9 @@ sub getReply {
 
     $message =~ tr/A-Z/a-z/;
 
-    if ($result = &getFactoid($message)) {
+    my ($result, $fauthor, $count) = &dbGet("factoids", 
+       "factoid_value,created_by,requested_count", "factoid_key=".&dbQuote($message) );
+    if ($result) {
        $lhs = $message;
        $mhs = "is";
        $rhs = $result;
@@ -48,7 +50,6 @@ sub getReply {
        $result =~ s/^\s*//;
     }
 
-    my $fauthor = &dbGet("factoids", "created_by", "factoid_key=".&dbQuote($message) );
     $result    = &SARit($result);
 
     $reply     = $result;
@@ -59,7 +60,6 @@ sub getReply {
        # stats code.
        ### FIXME: old mysql doesn't support
        ### "requested_count=requested_count+1".
-       my $count = &getFactInfo($lhs,"requested_count") || 0;
        $count++;
        ### BROKEN!!! - Tim Riker <Tim@Rikers.org> says it's fixed now
        if (0) {        # old code.