aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-08 16:21:26 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-08 16:21:26 +0000
commit18ed7b27eb73d5916ff746b8ddb330e6d1ab9de0 (patch)
treee5cf1f394e54ae7e48f9b0e3ca8ff4514e0a3fab /lib
parent73c6031a2546ad18ab0b454fe5d711715620d140 (diff)
downloadexternal_llvm-18ed7b27eb73d5916ff746b8ddb330e6d1ab9de0.zip
external_llvm-18ed7b27eb73d5916ff746b8ddb330e6d1ab9de0.tar.gz
external_llvm-18ed7b27eb73d5916ff746b8ddb330e6d1ab9de0.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/DeltaAlgorithm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/DeltaAlgorithm.cpp b/lib/Support/DeltaAlgorithm.cpp
index d176548..9e52874 100644
--- a/lib/Support/DeltaAlgorithm.cpp
+++ b/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())