fix direction factor computation on empty strings

This commit is contained in:
Sarah Hoffmann
2025-07-11 11:25:14 +02:00
parent 1aeb8a262c
commit 21ef3be433

View File

@@ -324,7 +324,7 @@ class QueryStruct:
of each node.
"""
n = len(self.nodes) - 1
if n == 1 or n >= 50:
if n <= 1 or n >= 50:
self.dir_penalty = 0
elif n == 2:
self.dir_penalty = (self.nodes[1].name_address_ratio()