Use std::swap

This commit is contained in:
Dmitry Marakasov 2013-12-18 16:21:55 +04:00
parent b0d0cb7911
commit c6d945120e

View File

@ -19,6 +19,8 @@
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
*/ */
#include <utility>
#include <SDL2/SDL_render.h> #include <SDL2/SDL_render.h>
#include <SDL2pp/Texture.hh> #include <SDL2pp/Texture.hh>
@ -62,9 +64,7 @@ void Texture::SetColorMod(Uint8 r, Uint8 g, Uint8 b) {
} }
void Texture::Swap(Texture& other) noexcept { void Texture::Swap(Texture& other) noexcept {
SDL_Texture* tmp = other.texture_; std::swap(texture_, other.texture_);
other.texture_ = texture_;
texture_ = tmp;
} }
} }