]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
gnulib-tool.py: Make data structures more clear.
authorCollin Funk <collin.funk1@gmail.com>
Tue, 16 Apr 2024 15:21:27 +0000 (08:21 -0700)
committerBruno Haible <bruno@clisp.org>
Tue, 16 Apr 2024 18:17:13 +0000 (20:17 +0200)
* pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a set to
represent the unconditional modules instead of a dictionary. Remove
redundant comments.
(GLModuleTable.addUnconditional): Add the module to a set instead of
using it as a key to the dictionary.

ChangeLog
pygnulib/GLModuleSystem.py

index b14171a863d2bc5cf9338cf60e2831068613cdc2..56dade056be4afcda7e39cac6fe64c1d4a148c5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-04-16  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Make data structures more clear.
+       * pygnulib/GLModuleSystem.py (GLModuleTable.__init__): Use a set to
+       represent the unconditional modules instead of a dictionary. Remove
+       redundant comments.
+       (GLModuleTable.addUnconditional): Add the module to a set instead of
+       using it as a key to the dictionary.
+
 2024-04-16  Bruno Haible  <bruno@clisp.org>
 
        setpayloadl: Add tests.
index 82b3c2f6e5a6d55924609597a9b7dd0194b81a9f..11f893402627f6abf04f9a5e5d7cfc6e460c3851 100644 (file)
@@ -727,13 +727,13 @@ class GLModuleTable:
           returns the condition when B should be enabled as a dependency of A,
           once the m4 code for A has been executed.
         '''
-        self.dependers = dict()  # Dependencies
-        self.conditionals = dict()  # Conditional modules
-        self.unconditionals = dict()  # Unconditional modules
-        self.base_modules = []  # Base modules
-        self.main_modules = []  # Main modules
-        self.tests_modules = []  # Tests modules
-        self.final_modules = []  # Final modules
+        self.dependers = dict()
+        self.conditionals = dict()
+        self.unconditionals = set()
+        self.base_modules = []
+        self.main_modules = []
+        self.tests_modules = []
+        self.final_modules = []
         if type(config) is not GLConfig:
             raise TypeError('config must be a GLConfig, not %s'
                             % type(config).__name__)
@@ -781,7 +781,7 @@ class GLModuleTable:
         if type(module) is not GLModule:
             raise TypeError('module must be a GLModule, not %s'
                             % type(module).__name__)
-        self.unconditionals[str(module)] = True
+        self.unconditionals.add(str(module))
         if str(module) in self.dependers:
             self.dependers.pop(str(module))