More tweaks for minor speed gains.

This commit is contained in:
green-ponies (jgen)
2012-01-12 21:17:37 -05:00
parent 3f7646bc8b
commit 2c6b5128c6
3 changed files with 25 additions and 22 deletions

View File

@@ -284,8 +284,11 @@ class Image {
*/
public function get_thumb_link() {
global $config;
if(strlen($config->get_string('image_tlink')) > 0) {
return $this->parse_link_template($config->get_string('image_tlink'));
$image_tlink = $config->get_string('image_tlink'); // store a copy for speed.
if( !empty($image_tlink) ) { /* empty is faster than strlen */
return $this->parse_link_template($image_tlink);
}
else if($config->get_bool('nice_urls', false)) {
return $this->parse_link_template(make_link('_thumbs/$hash/thumb.jpg'));