post queries: optimize zero tag and single tag searches.

Avoid going through the full post query parser for empty searches or
simple single-tag searches.
This commit is contained in:
evazion
2022-04-09 03:54:03 -05:00
parent 652db0cd9f
commit ca5dd61728
2 changed files with 15 additions and 2 deletions

View File

@@ -64,6 +64,10 @@ class PostQuery
concerning :ConstructorMethods do
class_methods do
def all
AST.new(:all, [])
end
def tag(name)
AST.new(:tag, [name])
end