diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-06-08 16:21:26 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-06-08 16:21:26 +0000 |
commit | f2363de7adc4214356a1416743ed80dc41e0582e (patch) | |
tree | 7b01f8160ea62945ec5ac6055aa5d13ec5182586 /llvm/lib/Support/DeltaAlgorithm.cpp | |
parent | 579ba2ac4255ef7319047cf3a690cd43c626e00a (diff) | |
download | bcm5719-llvm-f2363de7adc4214356a1416743ed80dc41e0582e.tar.gz bcm5719-llvm-f2363de7adc4214356a1416743ed80dc41e0582e.zip |
DeltaAlgorithm: Tweak split to split by first/second half instead of even/odd, since adjacent changes are more likely to be related.
llvm-svn: 105613
Diffstat (limited to 'llvm/lib/Support/DeltaAlgorithm.cpp')
-rw-r--r-- | llvm/lib/Support/DeltaAlgorithm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/DeltaAlgorithm.cpp b/llvm/lib/Support/DeltaAlgorithm.cpp index d1765481891..9e52874de83 100644 --- a/llvm/lib/Support/DeltaAlgorithm.cpp +++ b/llvm/lib/Support/DeltaAlgorithm.cpp @@ -30,10 +30,10 @@ void DeltaAlgorithm::Split(const changeset_ty &S, changesetlist_ty &Res) { // FIXME: This is really slow. changeset_ty LHS, RHS; - unsigned idx = 0; + unsigned idx = 0, N = S.size() / 2; for (changeset_ty::const_iterator it = S.begin(), ie = S.end(); it != ie; ++it, ++idx) - ((idx & 1) ? LHS : RHS).insert(*it); + ((idx < N) ? LHS : RHS).insert(*it); if (!LHS.empty()) Res.push_back(LHS); if (!RHS.empty()) |