chiark / gitweb /
doxygen: properly prefer shorter prefix.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 12 Jan 2019 15:16:48 +0000 (16:16 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Sat, 12 Jan 2019 15:16:48 +0000 (16:16 +0100)
The prefix_length is usually 0, since it's used for aliases, not
indicating the actual prefix length. So use the whole result length
instead.

doxygen/dox2html5.py
doxygen/test/test_search.py

index e8028a820fbb15d51fdebcc6530dfe1e43bb6748..ba290a3f1adc3493d76155f019e8e3852f29ef4f 100755 (executable)
@@ -316,8 +316,9 @@ class Trie:
                 # Third on suffix length (shortest first)
                 entry.suffix_length,
 
-                # Lastly on prefix length (shortest first)
-                entry.prefix_length
+                # Lastly on full name length (or prefix length, also shortest
+                # first)
+                len(entry.name)
             ]
 
         self._sort(key)
index e25c505b925001decc82d0294be8e6df52cfd15d..c6b71c5fb1935fbc131067781e87cbdb412f16f8 100755 (executable)
@@ -465,9 +465,9 @@ class [20]
 |          ) [12, 15, 19, 17]
 a group [29, 28]
 | page [52]
-value [31, 41]
+value [41, 31]
 | riable [48]
-enum [34, 44]
+enum [44, 34]
 |   :$
 |    :deprecatedvalue [33]
 |     onlyabrief [40]