Only call GetVSPath() once

Currently, GetVSPath() is called twice. The result if that call is used
locally in both situations.

This commit makes only one call, passing the result to where it is
needed.

Change-Id: I186bd7f0387091ad16c2791de99d1de8a89f266c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3510528
Auto-Submit: Chris Blume <cblume@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/28/3510528/6
Chris Blume 3 years ago committed by LUCI CQ
parent 1b4881c930
commit fba3a30684

@ -97,7 +97,7 @@ def BuildRepackageFileList(src_dir):
return result
def BuildFileList(override_dir, include_arm):
def BuildFileList(override_dir, include_arm, vs_path):
result = []
# Subset of VS corresponding roughly to VC.
@ -149,8 +149,6 @@ def BuildFileList(override_dir, include_arm):
'sysarm64'),
]
vs_path = GetVSPath()
for path in paths:
src = path[0] if isinstance(path, tuple) else path
# Note that vs_path is ignored if src is an absolute path.
@ -505,7 +503,7 @@ def main():
_vc_tools = temp_tools_path[len(vs_path) + 1:].replace('\\', '/')
print('Building file list for VS %s Windows %s...' % (_vs_version, _win_version))
files = BuildFileList(options.override_dir, options.arm)
files = BuildFileList(options.override_dir, options.arm, vs_path)
AddEnvSetup(files, options.arm)

Loading…
Cancel
Save