From 0604262b36b6dbf0d1eeb08b43fdb5bf60e6fd3b Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Thu, 1 Sep 2022 15:13:12 +0200 Subject: [PATCH] Replace list comprehension with a generator This avoids allocating a potentially long list. Signed-off-by: Valentin Lorentz --- src/licensedcode/match_set.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/licensedcode/match_set.py b/src/licensedcode/match_set.py index 105eeb9319e..4895638e544 100644 --- a/src/licensedcode/match_set.py +++ b/src/licensedcode/match_set.py @@ -149,7 +149,7 @@ def high_tids_set_subset(tids_set, len_legalese): """ Return a subset of a set of token ids that are only legalese tokens. """ - return intbitset([i for i in tids_set if i < len_legalese]) + return intbitset(i for i in tids_set if i < len_legalese) def high_tids_multiset_subset(mset, len_legalese):