From: timriker Date: Fri, 1 Nov 2002 21:09:14 +0000 (+0000) Subject: save 2 lookups while I'm at it X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9d71fb9d065e91d8fd5800fa17d14595ad79f9bf;p=infobot.git save 2 lookups while I'm at it git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@582 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index 88bc854..0d51865 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -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 says it's fixed now if (0) { # old code.