[vlmc-devel] Don't use std:swap in Commands::Clip::Move

Yikai Lu git at videolan.org
Thu Jul 28 14:39:25 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Thu Jul 28 18:07:11 2016 +0900| [19b71a699e34b223ded9a433f6257439bd26e270] | committer: Yikai Lu

Don't use std:swap in Commands::Clip::Move

> https://code.videolan.org/videolan/vlmc/commit/19b71a699e34b223ded9a433f6257439bd26e270
---

 src/Commands/Commands.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/Commands/Commands.cpp b/src/Commands/Commands.cpp
index e49b180..6f07aca 100644
--- a/src/Commands/Commands.cpp
+++ b/src/Commands/Commands.cpp
@@ -147,7 +147,6 @@ Commands::Clip::Move::internalRedo()
     {
         m_clip = m_oldTrack->removeClip( m_clip->uuid() );
         m_newTrack->addClip( m_clip, m_newPos );
-        std::swap( m_oldTrack, m_newTrack );
     }
     else
         m_oldTrack->moveClip( m_clip->uuid(), m_newPos );
@@ -158,9 +157,8 @@ Commands::Clip::Move::internalUndo()
 {
     if ( m_newTrack != m_oldTrack )
     {
-        m_clip = m_oldTrack->removeClip( m_clip->uuid() );
-        m_newTrack->addClip( m_clip, m_newPos );
-        std::swap( m_oldTrack, m_newTrack );
+        m_clip = m_newTrack->removeClip( m_clip->uuid() );
+        m_oldTrack->addClip( m_clip, m_oldPos );
     }
     else
         m_newTrack->moveClip( m_clip->uuid(), m_oldPos );



More information about the Vlmc-devel mailing list