? tokenauth.static.patch
Index: tokenauth.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tokenauth/Attic/tokenauth.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 tokenauth.inc
--- tokenauth.inc	2 Nov 2010 06:04:48 -0000	1.1.2.1
+++ tokenauth.inc	23 Jan 2011 07:33:19 -0000
@@ -97,10 +97,14 @@ function tokenauth_insert($uid = NULL, $
  *  A token, or NULL if user has no token.
  */
 function tokenauth_get_token($uid = NULL) {
+  static $tokens;
   if (is_null($uid)) {
     $uid = $GLOBALS['user']->uid;
   }
-  return db_result(db_query("SELECT tt.token FROM {tokenauth_tokens} tt WHERE tt.uid = %d", $uid));
+  if (!isset($tokens[$uid])) {
+    $tokens[$uid] = db_result(db_query("SELECT tt.token FROM {tokenauth_tokens} tt WHERE tt.uid = %d", $uid));
+  }
+  return $tokens[$uid];
 }
 
 /**
