mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Make the assignment operator for SmallPtrSet return a reference, and fix a long-standing bug in the copy
ctor while I'm at it. Thanks to Chris Lattner for help with this patch. llvm-svn: 38470
This commit is contained in:
parent
f1b6294e80
commit
e48ed4f7a8
@ -240,7 +240,7 @@ public:
|
||||
|
||||
// Allow assignment from any smallptrset with the same element type even if it
|
||||
// doesn't have the same smallsize.
|
||||
const SmallPtrSet<PtrType, SmallSize>
|
||||
const SmallPtrSet<PtrType, SmallSize>&
|
||||
operator=(const SmallPtrSet<PtrType, SmallSize> &RHS) {
|
||||
CopyFrom(RHS);
|
||||
return *this;
|
||||
|
@ -164,7 +164,7 @@ SmallPtrSetImpl::SmallPtrSetImpl(const SmallPtrSetImpl& that) {
|
||||
CurArray[CurArraySize] = 0;
|
||||
|
||||
// Copy over all valid entries.
|
||||
for (void **BucketPtr = that.CurArray, **E = that.CurArray+CurArraySize;
|
||||
for (void **BucketPtr = that.CurArray, **E = that.CurArray+that.CurArraySize;
|
||||
BucketPtr != E; ++BucketPtr) {
|
||||
// Copy over the element if it is valid.
|
||||
void *Elt = *BucketPtr;
|
||||
|
Loading…
Reference in New Issue
Block a user