[rtems-central commit] glossary: Remove global state

Sebastian Huber sebh at rtems.org
Thu Nov 5 10:46:17 UTC 2020


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov  5 11:44:50 2020 +0100

glossary: Remove global state

Initialize the dictionaries each time the glossary() function is called.

---

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

diff --git a/rtemsspec/glossary.py b/rtemsspec/glossary.py
index c744587..21a39e8 100644
--- a/rtemsspec/glossary.py
+++ b/rtemsspec/glossary.py
@@ -36,8 +36,8 @@ ItemMap = Dict[str, Item]
 
 class _Glossary(NamedTuple):
     """ A glossary of terms. """
-    uid_to_item: ItemMap = {}
-    term_to_item: ItemMap = {}
+    uid_to_item: ItemMap
+    term_to_item: ItemMap
 
 
 def _gather_glossary_terms(item: Item, glossary: _Glossary) -> None:
@@ -132,7 +132,7 @@ def generate(config: dict, item_cache: ItemCache) -> None:
         if item.type == "glossary/group":
             groups[uid] = item
 
-    project_glossary = _Glossary()
+    project_glossary = _Glossary({}, {})
     for group in config["project-groups"]:
         _gather_glossary_terms(groups[group], project_glossary)
 



More information about the vc mailing list