Merge pull request #3779 from lonvia/fix-zero-devision-direction

Fix direction factor computation on empty strings
This commit is contained in:
Sarah Hoffmann
2025-07-11 14:51:00 +02:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -331,7 +331,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()