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 16
16
#include " player.h"
17
17
#include " api/dartmanager.h"
18
18
#include " dart_api_dl.h"
19
-
20
19
#ifdef __cplusplus
21
20
extern " C" {
22
21
#endif
@@ -183,19 +182,20 @@ inline void OnOpen(int32_t id, PlayerState* state) {
183
182
is_playlist_object.type = Dart_CObject_kBool;
184
183
is_playlist_object.value .as_int32 = state->is_playlist ();
185
184
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) {
188
187
Dart_CObject media_type_object;
189
188
media_type_object.type = Dart_CObject_kString;
190
189
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 ());
192
191
193
192
Dart_CObject resource_object;
194
193
resource_object.type = Dart_CObject_kString;
195
194
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 ;
199
199
}
200
200
201
201
Dart_CObject return_object;
You can’t perform that action at this time.
0 commit comments