From 3510adeacca613ff9d9bba50f3131ae12b582c3c Mon Sep 17 00:00:00 2001 From: rameshm Date: Wed, 4 Dec 2024 18:08:14 +1100 Subject: [PATCH] fix flatten stack splits contiguous clips issue and add tests Signed-off-by: Ramesh Maddhu Signed-off-by: Mark Reid --- src/opentimelineio/stackAlgorithm.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/opentimelineio/stackAlgorithm.cpp b/src/opentimelineio/stackAlgorithm.cpp index 17a8aeb4a..ac0cd3ccb 100644 --- a/src/opentimelineio/stackAlgorithm.cpp +++ b/src/opentimelineio/stackAlgorithm.cpp @@ -74,8 +74,7 @@ _flatten_next_item( } auto children = track->children(); - int children_size = static_cast(children.size()); - for (int i = 0; i < children_size; i++) + for (size_t i = 0; i < children.size(); i++) { std::optional trim = std::nullopt; SerializableObject::Retainer child = children[i]; @@ -103,7 +102,7 @@ _flatten_next_item( trim = child_trim; } - if (i+1 < children_size) + if (i+1 < children.size()) { child = children[i++]; }