projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
02cee38
)
memcpy with zero length is hugely expensive, so avoid it. This speeds up coallescing...
author
Chris Lattner
<sabre@nondot.org>
Fri, 10 Aug 2007 07:02:50 +0000
(07:02 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Fri, 10 Aug 2007 07:02:50 +0000
(07:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40984
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/SmallVector.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/SmallVector.h
b/include/llvm/ADT/SmallVector.h
index 1c970a55981c471d8a3b7a1d289bd1c32bc6ea34..e6c81a6420c2399e5e5764bac448b0a56675e2a2 100644
(file)
--- a/
include/llvm/ADT/SmallVector.h
+++ b/
include/llvm/ADT/SmallVector.h
@@
-380,7
+380,11
@@
SmallVectorImpl<T>::operator=(const SmallVectorImpl<T> &RHS) {
unsigned CurSize = unsigned(size());
if (CurSize >= RHSSize) {
// Assign common elements.
- iterator NewEnd = std::copy(RHS.Begin, RHS.Begin+RHSSize, Begin);
+ iterator NewEnd;
+ if (RHSSize)
+ NewEnd = std::copy(RHS.Begin, RHS.Begin+RHSSize, Begin);
+ else
+ NewEnd = Begin;
// Destroy excess elements.
destroy_range(NewEnd, End);