File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1616#include " player.h"
1717#include " api/dartmanager.h"
1818#include " dart_api_dl.h"
19-
2019#ifdef __cplusplus
2120extern " C" {
2221#endif
@@ -183,19 +182,20 @@ inline void OnOpen(int32_t id, PlayerState* state) {
183182 is_playlist_object.type = Dart_CObject_kBool;
184183 is_playlist_object.value .as_int32 = state->is_playlist ();
185184 value_objects[3 ] = &is_playlist_object;
186-
187- for (int32_t i = 0 ; i < media_items. size (); i += 2 ) {
185+ int index = 0 ;
186+ for (const auto & media : media_items) {
188187 Dart_CObject media_type_object;
189188 media_type_object.type = Dart_CObject_kString;
190189 media_type_object.value .as_string =
191- const_cast <char *>(media_items[i] ->media_type ().c_str ());
190+ const_cast <char *>(media ->media_type ().c_str ());
192191
193192 Dart_CObject resource_object;
194193 resource_object.type = Dart_CObject_kString;
195194 resource_object.value .as_string =
196- const_cast <char *>(media_items[i]->resource ().c_str ());
197- value_objects[i + 4 ] = &media_type_object;
198- value_objects[i + 5 ] = &resource_object;
195+ const_cast <char *>(media->resource ().c_str ());
196+ value_objects[index + 4 ] = &media_type_object;
197+ value_objects[index + 5 ] = &resource_object;
198+ index += 2 ;
199199 }
200200
201201 Dart_CObject return_object;
You can’t perform that action at this time.
0 commit comments