Slight optimization in tag searches.

toying-with-ramdb
Philippe PITTOLI 2024-05-09 16:21:46 +02:00
parent 0b4cdf00b7
commit d29b29bc1b
1 changed files with 2 additions and 1 deletions

View File

@ -62,11 +62,12 @@ class DODB::Tags(V) < DODB::Indexer(V)
return r_value if keys.size < 1 return r_value if keys.size < 1
first_key = keys.pop 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| keys.each do |tag|
values = get_with_indice(tag) rescue return [] of Tuple(V, Int32) values = get_with_indice(tag) rescue return [] of Tuple(V, Int32)
r_value &= values r_value &= values
return r_value if r_value.size < 1
end end
r_value r_value
end end