diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-08-07 22:56:07 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-08-07 22:56:07 (GMT) |
commit | f54f0f9499c53f5f5981e9397beb288f027aec31 (patch) | |
tree | 3f10b45b77a5b0b24617b2fe4799ce0d3efa1110 /src/engine | |
parent | 8ca7e7567aa44a8c0f74d00e78503cd94a8794b0 (diff) | |
download | SCons-f54f0f9499c53f5f5981e9397beb288f027aec31.zip SCons-f54f0f9499c53f5f5981e9397beb288f027aec31.tar.gz SCons-f54f0f9499c53f5f5981e9397beb288f027aec31.tar.bz2 |
PR #344 - Use set() where applicable. In many cases this can lead to performance improvements
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Environment.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 480a1d6..4f8e41b 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -167,7 +167,7 @@ def _set_SCANNERS(env, key, value): def _delete_duplicates(l, keep_last): """Delete duplicates from a sequence, keeping the first or last.""" - seen={} + seen=set() result=[] if keep_last: # reverse in & out, then keep first l.reverse() @@ -175,7 +175,7 @@ def _delete_duplicates(l, keep_last): try: if i not in seen: result.append(i) - seen[i]=1 + seen.add(i) except TypeError: # probably unhashable. Just keep it. result.append(i) |