diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
commit | 66e41e3c6e8b8fbc48d5d3b4d2bd9ce0be4ecb75 (patch) | |
tree | 9de1c5f67a98cd0e73c60838396486c984f63ac2 /lib/Support/DeltaAlgorithm.cpp | |
parent | abdf259d487163e72081a8cf4991b1617206b41e (diff) |
Notes
Diffstat (limited to 'lib/Support/DeltaAlgorithm.cpp')
-rw-r--r-- | lib/Support/DeltaAlgorithm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/DeltaAlgorithm.cpp b/lib/Support/DeltaAlgorithm.cpp index d176548189191..9e52874de8326 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()) |