diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-11-22 13:11:05 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-11-22 13:11:05 +0000 |
commit | f8d3bf979817397c6b57bb7296e905b5e0d2be5e (patch) | |
tree | e647e96ea6c5f0580c8a529030df3c568421bf4d /modules | |
parent | ea28f6b7d085d4ed77826065d75be67a342ae96a (diff) | |
download | brdo-f8d3bf979817397c6b57bb7296e905b5e0d2be5e.tar.gz brdo-f8d3bf979817397c6b57bb7296e905b5e0d2be5e.tar.bz2 |
- Patch #330674 by catch: we can eliminate one database query because we have the parent node cached anyway.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/node/node.module | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index b64dbdebf..1ac8a9d20 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1446,11 +1446,8 @@ function theme_node_search_admin($form) { * Retrieve the comment mode for the given node ID (none, read, or read/write). */ function node_comment_mode($nid) { - static $comment_mode; - if (!isset($comment_mode[$nid])) { - $comment_mode[$nid] = db_result(db_query('SELECT comment FROM {node} WHERE nid = %d', $nid)); - } - return $comment_mode[$nid]; + $node = node_load($nid); + return $node->comment; } /** |