Slight optimization in tag searches.
This commit is contained in:
parent
e4f1120335
commit
e74e7b8a61
@ -62,11 +62,12 @@ class DODB::Tags(V) < DODB::Indexer(V)
|
||||
return r_value if keys.size < 1
|
||||
|
||||
first_key = keys.pop
|
||||
r_value = get_with_indice(first_key) rescue return [] of Tuple(V, Int32)
|
||||
r_value = get_with_indice(first_key) rescue return r_value
|
||||
|
||||
keys.each do |tag|
|
||||
values = get_with_indice(tag) rescue return [] of Tuple(V, Int32)
|
||||
r_value &= values
|
||||
return r_value if r_value.size < 1
|
||||
end
|
||||
r_value
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user