Skip to content

Commit

Permalink
optimise header duplication detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthapz committed Jan 31, 2024
1 parent 69e66b7 commit 7d5573a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xmake/rules/c++/modules/modules_support/builder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ function _target_module_map_cachekey(target)
end

function _is_duplicated_headerunit(target, key)
local mapper = get_target_module_mapper(target)
for _, mapped in pairs(mapper) do
if mapped.key == key then
return mapped
local mapper, mapper_keys = get_target_module_mapper(target)
for _, mapped_key in ipairs(mapper_keys) do
if mapped_key == key then
return mapper[mapped_key]
end
end
end
Expand Down Expand Up @@ -338,7 +338,7 @@ function get_target_module_mapper(target)
memcache:set2(target:name(), "module_mapper", mapper)
end

return mapper
return mapper, table.keys(mapper)
end

-- get a module or headerunit from target mapper
Expand Down

0 comments on commit 7d5573a

Please sign in to comment.