From d29b29bc1b140821e7cf298d6b4b4a449409fb0c Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Thu, 9 May 2024 16:21:46 +0200 Subject: [PATCH] Slight optimization in tag searches. --- src/dodb/tags.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dodb/tags.cr b/src/dodb/tags.cr index 3a5d153..6530983 100644 --- a/src/dodb/tags.cr +++ b/src/dodb/tags.cr @@ -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