Commit 4864cfcb authored by luyikei's avatar luyikei

main.qml: Optimize findClipItem

parent ac7bf721
......@@ -211,6 +211,7 @@ Rectangle {
selected = true;
newTrackId = trackId;
allClips.push( clip );
allClipsDict[uuid] = clip;
updateEffects( workflow.clipInfo( uuid ) );
......
......@@ -18,6 +18,7 @@ Rectangle {
property int maxZ: 100
property int scale: 4
property var allClips: [] // Actual clip item objects
property var allClipsDict: ({}) // Actual clip item objects
property var selectedClips: [] // Actual clip item objects
property var groups: [] // list of lists of clip uuids
property var linkedClipsDict: ({}) // Uuid
......@@ -166,11 +167,7 @@ Rectangle {
}
function findClipItem( uuid ) {
for ( var i = 0; i < allClips.length; ++i ) {
if ( uuid === allClips[i].uuid )
return allClips[i];
}
return null;
return allClipsDict[uuid];
}
function adjustTracks( trackType ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment