diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-04-03 16:28:44 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-04-05 12:08:32 +0200 |
commit | 469a7190bee490344d147099c3511fc45e2aadf0 (patch) | |
tree | 5a7cd59ac3ef6ee0ec9203632bfd478b4e670115 /src | |
parent | dc97c25fabb53f95c4f0826db2323008e22505fd (diff) | |
download | justbuild-469a7190bee490344d147099c3511fc45e2aadf0.tar.gz |
bug fix in expresion, Union: propagate the disjointness property
To avoid too many intermediate results, we compute the union of
a list in a divide and conquer fashion. Of course, for a disjoint
union, the recursive calls on the lists of half the length have to
be disjoint as well, i.e., the template parameter kDisjoint has to
be passed on. Fix this.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/build_engine/expression/evaluator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildtool/build_engine/expression/evaluator.cpp b/src/buildtool/build_engine/expression/evaluator.cpp index 8945fe0e..34e0873b 100644 --- a/src/buildtool/build_engine/expression/evaluator.cpp +++ b/src/buildtool/build_engine/expression/evaluator.cpp @@ -344,8 +344,8 @@ auto Union(Expression::list_t const& dicts, size_t from, size_t to) return entry; } size_t mid = from + (to - from) / 2; - auto left = Union(dicts, from, mid); - auto right = Union(dicts, mid, to); + auto left = Union<kDisjoint>(dicts, from, mid); + auto right = Union<kDisjoint>(dicts, mid, to); if (left->Map().empty()) { return right; } |