1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00

Fix PR3860 by correcting a predicate.

llvm-svn: 67473
This commit is contained in:
Chris Lattner 2009-03-22 19:22:53 +00:00
parent dca010d0d7
commit 9c7b21d369

View File

@ -293,10 +293,11 @@ public:
// Uninvalidate the iterator.
I = begin()+InsertElt;
// If we already have this many elements in the collection, append the
// dest elements at the end, then copy over the appropriate elements. Since
// we already reserved space, we know that this won't reallocate the vector.
if (size() >= NumToInsert) {
// If there are more elements between the insertion point and the end of the
// range than there are being inserted, we can use a simple approach to
// insertion. Since we already reserved space, we know that this won't
// reallocate the vector.
if (size_t(end()-I) >= NumToInsert) {
T *OldEnd = End;
append(End-NumToInsert, End);
@ -341,10 +342,11 @@ public:
// Uninvalidate the iterator.
I = begin()+InsertElt;
// If we already have this many elements in the collection, append the
// dest elements at the end, then copy over the appropriate elements. Since
// we already reserved space, we know that this won't reallocate the vector.
if (size() >= NumToInsert) {
// If there are more elements between the insertion point and the end of the
// range than there are being inserted, we can use a simple approach to
// insertion. Since we already reserved space, we know that this won't
// reallocate the vector.
if (size_t(end()-I) >= NumToInsert) {
T *OldEnd = End;
append(End-NumToInsert, End);