mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
DeltaAlgorithm: Tweak split to split by first/second half instead of even/odd, since adjacent changes are more likely to be related.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105613 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -30,10 +30,10 @@ void DeltaAlgorithm::Split(const changeset_ty &S, changesetlist_ty &Res) {
|
|||||||
|
|
||||||
// FIXME: This is really slow.
|
// FIXME: This is really slow.
|
||||||
changeset_ty LHS, RHS;
|
changeset_ty LHS, RHS;
|
||||||
unsigned idx = 0;
|
unsigned idx = 0, N = S.size() / 2;
|
||||||
for (changeset_ty::const_iterator it = S.begin(),
|
for (changeset_ty::const_iterator it = S.begin(),
|
||||||
ie = S.end(); it != ie; ++it, ++idx)
|
ie = S.end(); it != ie; ++it, ++idx)
|
||||||
((idx & 1) ? LHS : RHS).insert(*it);
|
((idx < N) ? LHS : RHS).insert(*it);
|
||||||
if (!LHS.empty())
|
if (!LHS.empty())
|
||||||
Res.push_back(LHS);
|
Res.push_back(LHS);
|
||||||
if (!RHS.empty())
|
if (!RHS.empty())
|
||||||
|
Reference in New Issue
Block a user