optimise a very common (99%) case
git-svn-id: file:///home/shish/svn/shimmie2/trunk@210 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
a917073fee
commit
a92b2fdcab
1 changed files with 5 additions and 0 deletions
|
@ -151,6 +151,11 @@ class Database {
|
|||
if($positive_tag_count + $negative_tag_count == 0) {
|
||||
$query = new Querylet($this->get_images);
|
||||
}
|
||||
else if($positive_tag_count == 1 && $negative_tag_count == 0) {
|
||||
$query = new Querylet(
|
||||
"{$this->get_images} WHERE images.id IN (SELECT image_id FROM tags WHERE tag = ?) ",
|
||||
$tag_search->variables);
|
||||
}
|
||||
else {
|
||||
$s_tag_array = array_map("sql_escape", $tag_search->variables);
|
||||
$s_tag_list = join(', ', $s_tag_array);
|
||||
|
|
Reference in a new issue