[vlmc-devel] [PATCH] SequenceWorkflow: shorten clear() function

Hieu Pham phamhuuquanghieu at gmail.com
Fri Apr 7 08:58:06 CEST 2017


---
 src/Workflow/SequenceWorkflow.cpp | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/Workflow/SequenceWorkflow.cpp b/src/Workflow/SequenceWorkflow.cpp
index 8b332bf..c669162 100644
--- a/src/Workflow/SequenceWorkflow.cpp
+++ b/src/Workflow/SequenceWorkflow.cpp
@@ -263,7 +263,6 @@ SequenceWorkflow::loadFromVariant( const QVariant& variant )
 
         auto uuid = m["uuid"].toUuid();
         auto isAudio = m["isAudio"].toBool();
-        //FIXME: Add missing clip type handling. We don't know if we're adding an audio clip or not
         addClip( clip, m["trackId"].toUInt(), m["position"].toLongLong(), uuid, isAudio );
         auto c = m_clips[uuid];
 
@@ -283,13 +282,8 @@ SequenceWorkflow::loadFromVariant( const QVariant& variant )
 void
 SequenceWorkflow::clear()
 {
-    auto it = m_clips.begin();
-    while ( it != m_clips.end() )
-    {
-        removeClip( it.key() );
-        // m_clips.begin() can be changed
-        it = m_clips.begin();
-    }
+    while ( !m_clips.empty() )
+        removeClip( m_clips.begin().key() );
 }
 
 QSharedPointer<SequenceWorkflow::ClipInstance>
-- 
2.9.3



More information about the Vlmc-devel mailing list