Skip to content

Commit

Permalink
BaseTools: use map and filter to replace the itertools function
Browse files Browse the repository at this point in the history
Cc: Liming Gao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
  • Loading branch information
yunhuafx authored and Yonghong Zhu committed Oct 13, 2018
1 parent 4ce4f75 commit fe3991d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions BaseTools/Source/Python/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import platform
import traceback
import encodings.ascii
import itertools
import multiprocessing

from struct import *
Expand Down Expand Up @@ -1172,9 +1171,9 @@ def LaunchPrebuild(self):
f = open(PrebuildEnvFile)
envs = f.readlines()
f.close()
envs = itertools.imap(lambda l: l.split('=', 1), envs)
envs = itertools.ifilter(lambda l: len(l) == 2, envs)
envs = itertools.imap(lambda l: [i.strip() for i in l], envs)
envs = map(lambda l: l.split('=', 1), envs)
envs = filter(lambda l: len(l) == 2, envs)
envs = map(lambda l: [i.strip() for i in l], envs)
os.environ.update(dict(envs))
EdkLogger.info("\n- Prebuild Done -\n")

Expand Down

0 comments on commit fe3991d

Please sign in to comment.