File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -74,9 +74,10 @@ _flatten_next_item(
7474 }
7575
7676 auto children = track->children ();
77- for (int i = 0 ; i < children.size (); i++)
77+ int children_size = static_cast <int >(children.size ());
78+ for (int i = 0 ; i < children_size; i++)
7879 {
79- std::optional<TimeRange> trim = std::nullopt ;;
80+ std::optional<TimeRange> trim = std::nullopt ;
8081 SerializableObject::Retainer<Composable> child = children[i];
8182
8283 // combine all non visible children into one continuous range
@@ -102,7 +103,7 @@ _flatten_next_item(
102103 trim = child_trim;
103104 }
104105
105- if (i+1 < children. size () )
106+ if (i+1 < children_size )
106107 {
107108 child = children[i++];
108109 }
Original file line number Diff line number Diff line change @@ -259,6 +259,9 @@ main(int argc, char** argv)
259259 assertEqual (result->children ().size (), 1 );
260260 assertEqual (result->children ()[0 ]->name (), std::string (" track2_C" ));
261261 assertEqual (result->duration ().value (), 300 );
262+ assertEqual (st->children ().size (), 2 );
263+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[0 ].value )->children ().size (), 1 );
264+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[1 ].value )->children ().size (), 2 );
262265 });
263266
264267 tests.add_test (
@@ -309,8 +312,11 @@ main(int argc, char** argv)
309312 assertEqual (result->children ()[0 ]->name (), std::string (" track2_C" ));
310313 assertEqual (result->children ()[1 ]->name (), std::string (" track2_D" ));
311314 assertEqual (result->duration ().value (), 300 );
315+ assertEqual (st->children ().size (), 2 );
316+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[0 ].value )->children ().size (), 2 );
317+ assertEqual (dynamic_cast <otio::Track*>(st->children ()[1 ].value )->children ().size (), 2 );
312318 });
313319
314320 tests.run (argc, argv);
315321 return 0 ;
316- }
322+ }
You can’t perform that action at this time.
0 commit comments