From 6cca6d7e01d87a7703bb46c9da94a4dc6a5f7d88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 May 2020 08:43:01 +0200 Subject: [PATCH] documentation: reduce magic constants in search implementation a bit. --- documentation/_search.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/_search.py b/documentation/_search.py index cd8b6438..482fd3d5 100644 --- a/documentation/_search.py +++ b/documentation/_search.py @@ -232,15 +232,15 @@ class ResultMap: # The entry is an alias, extra field for alias index if e.flags & ResultFlag._TYPE == ResultFlag.ALIAS: - offset += 2 + offset += self.alias_struct.size # Extra field for prefix index and length if e.flags & ResultFlag.HAS_PREFIX: - offset += 3 + offset += self.prefix_struct.size # Extra field for suffix length if e.flags & ResultFlag.HAS_SUFFIX: - offset += 1 + offset += self.suffix_length_struct.size # Length of the name offset += len(e.name.encode('utf-8')) -- 2.30.2