From: Collin Funk Date: Mon, 3 Jun 2024 11:57:14 +0000 (-0700) Subject: gnulib-tool.py: Use a set to optimize. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c1cdc5ef8ef8b22d46bf55d8cb992f0b75532b46;p=gnulib.git 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). --- diff --git a/ChangeLog b/ChangeLog index 40238433eb..3e1e553dc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-06-03 Collin Funk + + 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 pthread-* tests, regex tests: Prepare for use of 'alarm'. diff --git a/pygnulib/GLModuleSystem.py b/pygnulib/GLModuleSystem.py index 5d67c5b6df..02dacfcf9f 100644 --- a/pygnulib/GLModuleSystem.py +++ b/pygnulib/GLModuleSystem.py @@ -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/', '')