speed: don't check tag for metatag if doesn't contain : or =
This commit is contained in:
parent
43d0a297b8
commit
de761c11d7
1 changed files with 7 additions and 0 deletions
|
@ -110,6 +110,13 @@ class TagSetEvent extends Event {
|
|||
$tag_array = Tag::resolve_aliases($tag_array);
|
||||
|
||||
foreach($tag_array as $tag) {
|
||||
if((strpos($tag, ':') === FALSE) && (strpos($tag, '=') === FALSE)) {
|
||||
//Tag doesn't contain : or =, meaning it can't possibly be a metatag.
|
||||
//This should help speed wise, as it avoids running every single tag through a bunch of preg_match instead.
|
||||
array_push($this->tags, $tag);
|
||||
continue;
|
||||
}
|
||||
|
||||
$ttpe = new TagTermParseEvent($tag, $this->image->id, FALSE); //Only check for metatags, don't parse. Parsing is done after set_tags.
|
||||
send_event($ttpe);
|
||||
|
||||
|
|
Reference in a new issue