Skip to content

Commit 9fc8faa

Browse files
committed
Swift: Address review comments
1 parent b6b3767 commit 9fc8faa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

swift/tools/tracing-config.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ function RegisterExtractorPack(id)
6262
-- resource-dir in this case by skipping over the -Xcc that follows it and stripping off the
6363
-- clang suffix from the path.
6464
function find_original_resource_dir(compilerPath, args)
65-
local resource_dir_index = indexOf(args, '-resource-dir')
66-
if resource_dir_index then
67-
if args[resource_dir_index + 1] and args[resource_dir_index + 1] ~= '-Xcc' then
68-
return args[resource_dir_index + 1]
69-
elseif args[resource_dir_index + 2] then
70-
local clang_index = string.find(args[resource_dir_index + 2], "/clang$")
65+
local found = indexOf(args, '-resource-dir')
66+
if found and args[found + 1] then
67+
if args[found - 1] ~= '-Xcc' then
68+
return args[found + 1]
69+
elseif args[found + 1] == '-Xcc' and args[found + 2] then
70+
local clang_index = string.find(args[found + 2], "/clang$")
7171
if clang_index and clang_index - 1 > 0 then
72-
return string.sub(args[resource_dir_index + 2], 1, clang_index - 1)
72+
return string.sub(args[found + 2], 1, clang_index - 1)
7373
end
7474
end
7575
end

0 commit comments

Comments
 (0)