@@ -192,7 +192,7 @@ void SmallPtrSetImplBase::MoveHelper(unsigned SmallSize,
192192 if (RHS.isSmall ()) {
193193 // Copy a small RHS rather than moving.
194194 CurArray = SmallArray;
195- std::copy (RHS.CurArray , RHS. CurArray + RHS.NumNonEmpty , CurArray);
195+ std::copy_n (RHS.CurArray , RHS.NumNonEmpty , CurArray);
196196 } else {
197197 CurArray = RHS.CurArray ;
198198 RHS.CurArray = RHS.SmallArray ;
@@ -228,7 +228,7 @@ void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
228228 // from LHS to RHS.
229229 if (!this ->isSmall () && RHS.isSmall ()) {
230230 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 );
232232 std::swap (RHS.CurArraySize , this ->CurArraySize );
233233 std::swap (this ->NumNonEmpty , RHS.NumNonEmpty );
234234 std::swap (this ->NumTombstones , RHS.NumTombstones );
@@ -241,7 +241,7 @@ void SmallPtrSetImplBase::swap(SmallPtrSetImplBase &RHS) {
241241 // from RHS to LHS.
242242 if (this ->isSmall () && !RHS.isSmall ()) {
243243 assert (this ->CurArray == this ->SmallArray );
244- std::copy (this ->CurArray , this -> CurArray + this ->NumNonEmpty ,
244+ std::copy_n (this ->CurArray , this ->NumNonEmpty ,
245245 RHS.SmallArray );
246246 std::swap (RHS.CurArraySize , this ->CurArraySize );
247247 std::swap (RHS.NumNonEmpty , this ->NumNonEmpty );
0 commit comments