@@ -192,7 +192,7 @@ void SmallPtrSetImplBase::MoveHelper(unsigned SmallSize,
192
192
if (RHS.isSmall ()) {
193
193
// Copy a small RHS rather than moving.
194
194
CurArray = SmallArray;
195
- std::copy (RHS.CurArray , RHS. CurArray + RHS.NumNonEmpty , CurArray);
195
+ std::copy_n (RHS.CurArray , RHS.NumNonEmpty , CurArray);
196
196
} else {
197
197
CurArray = RHS.CurArray ;
198
198
RHS.CurArray = RHS.SmallArray ;
@@ -228,7 +228,7 @@ void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
228
228
// from LHS to RHS.
229
229
if (!this ->isSmall () && RHS.isSmall ()) {
230
230
assert (RHS.CurArray == RHS.SmallArray );
231
- std::copy (RHS.CurArray , RHS. CurArray + RHS.NumNonEmpty , this ->SmallArray );
231
+ std::copy_n (RHS.CurArray , RHS.NumNonEmpty , this ->SmallArray );
232
232
std::swap (RHS.CurArraySize , this ->CurArraySize );
233
233
std::swap (this ->NumNonEmpty , RHS.NumNonEmpty );
234
234
std::swap (this ->NumTombstones , RHS.NumTombstones );
@@ -241,7 +241,7 @@ void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
241
241
// from RHS to LHS.
242
242
if (this ->isSmall () && !RHS.isSmall ()) {
243
243
assert (this ->CurArray == this ->SmallArray );
244
- std::copy (this ->CurArray , this -> CurArray + this ->NumNonEmpty ,
244
+ std::copy_n (this ->CurArray , this ->NumNonEmpty ,
245
245
RHS.SmallArray );
246
246
std::swap (RHS.CurArraySize , this ->CurArraySize );
247
247
std::swap (RHS.NumNonEmpty , this ->NumNonEmpty );
0 commit comments