]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool.py: Use a set to optimize.
authorCollin Funk <collin.funk1@gmail.com>
Mon, 3 Jun 2024 11:57:14 +0000 (04:57 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Mon, 3 Jun 2024 11:57:14 +0000 (04:57 -0700)
* pygnulib/GLModuleSystem.py
(GLModule.getAutomakeSnippet_Unconditional): Call set() on the result of
_extract_lib_SOURCES() to ensure computing the difference between
another set is O(n).

ChangeLog
pygnulib/GLModuleSystem.py

index 40238433eb4d02b16331cd2bf7535c487829564f..3e1e553dc44aeb8ffb328771ba31bd0185040032 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-06-03  Collin Funk  <collin.funk1@gmail.com>
+
+       gnulib-tool.py: Use a set to optimize.
+       * pygnulib/GLModuleSystem.py
+       (GLModule.getAutomakeSnippet_Unconditional): Call set() on the result of
+       _extract_lib_SOURCES() to ensure computing the difference between
+       another set is O(n).
+
 2024-06-03  Bruno Haible  <bruno@clisp.org>
 
        pthread-* tests, regex tests: Prepare for use of 'alarm'.
index 5d67c5b6df7eef7f0335d1ef70f055de2d49812e..02dacfcf9fd56a65bd83f48e8807f96b7666ee0d 100644 (file)
@@ -587,7 +587,7 @@ class GLModule:
                 snippet = self.getAutomakeSnippet_Conditional()
                 snippet = combine_lines(snippet)
                 # Get all the file names from 'lib_SOURCES += ...'.
-                mentioned_files = _extract_lib_SOURCES(snippet)
+                mentioned_files = set(_extract_lib_SOURCES(snippet))
                 all_files = self.getFiles()
                 lib_files = filter_filelist('\n', all_files,
                                             'lib/', '', 'lib/', '')