Commit fba3a306 authored by Chris Blume's avatar Chris Blume Committed by LUCI CQ

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: 's avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 1b4881c9
...@@ -97,7 +97,7 @@ def BuildRepackageFileList(src_dir): ...@@ -97,7 +97,7 @@ def BuildRepackageFileList(src_dir):
return result return result
def BuildFileList(override_dir, include_arm): def BuildFileList(override_dir, include_arm, vs_path):
result = [] result = []
# Subset of VS corresponding roughly to VC. # Subset of VS corresponding roughly to VC.
...@@ -149,8 +149,6 @@ def BuildFileList(override_dir, include_arm): ...@@ -149,8 +149,6 @@ def BuildFileList(override_dir, include_arm):
'sysarm64'), 'sysarm64'),
] ]
vs_path = GetVSPath()
for path in paths: for path in paths:
src = path[0] if isinstance(path, tuple) else path src = path[0] if isinstance(path, tuple) else path
# Note that vs_path is ignored if src is an absolute path. # Note that vs_path is ignored if src is an absolute path.
...@@ -505,7 +503,7 @@ def main(): ...@@ -505,7 +503,7 @@ def main():
_vc_tools = temp_tools_path[len(vs_path) + 1:].replace('\\', '/') _vc_tools = temp_tools_path[len(vs_path) + 1:].replace('\\', '/')
print('Building file list for VS %s Windows %s...' % (_vs_version, _win_version)) 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) AddEnvSetup(files, options.arm)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment