[rtems-central commit] glossary: Simplify

Sebastian Huber sebh at rtems.org
Thu Oct 8 13:25:41 UTC 2020


Module:    rtems-central
Branch:    master
Commit:    262d847ae63e1746bd050e7e45f1a36fec54b56a
Changeset: http://git.rtems.org/rtems-central/commit/?id=262d847ae63e1746bd050e7e45f1a36fec54b56a

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Oct  2 16:01:14 2020 +0200

glossary: Simplify

---

 rtemsspec/glossary.py | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/rtemsspec/glossary.py b/rtemsspec/glossary.py
index 1131f45..bb0bf49 100644
--- a/rtemsspec/glossary.py
+++ b/rtemsspec/glossary.py
@@ -40,13 +40,6 @@ class _Glossary(NamedTuple):
     term_to_item: ItemMap = {}
 
 
-def _gather_glossary_groups(item: Item, glossary_groups: ItemMap) -> None:
-    for child in item.children():
-        _gather_glossary_groups(child, glossary_groups)
-    if item["type"] == "glossary" and item["glossary-type"] == "group":
-        glossary_groups[item.uid] = item
-
-
 def _gather_glossary_terms(item: Item, glossary: _Glossary) -> None:
     for child in item.children():
         _gather_glossary_terms(child, glossary)
@@ -126,8 +119,9 @@ def generate(config: dict, item_cache: ItemCache) -> None:
                        groups and terms.
     """
     groups = {}  # type: ItemMap
-    for item in item_cache.top_level.values():
-        _gather_glossary_groups(item, groups)
+    for uid, item in item_cache.all.items():
+        if item.type == "glossary/group":
+            groups[uid] = item
 
     project_glossary = _Glossary()
     for group in config["project-groups"]:



More information about the vc mailing list