@@ -570,12 +570,10 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
570570 if (drop_type == " files" ) {
571571 PackedStringArray files = drag_data[" files" ];
572572
573- for (int i = 0 ; i < files.size (); i++) {
574- const String &file = files[i];
575- String ftype = EditorFileSystem::get_singleton ()->get_file_type (file);
576-
577- for (int j = 0 ; j < allowed_type.get_slice_count (" ," ); j++) {
578- String at = allowed_type.get_slice (" ," , j).strip_edges ();
573+ for (const String &file : files) {
574+ const String ftype = EditorFileSystem::get_singleton ()->get_file_type (file);
575+ for (String at : allowed_type.split (" ," )) {
576+ at = at.strip_edges ();
579577 // Fail if one of the files is not of allowed type.
580578 if (!ClassDB::is_parent_class (ftype, at)) {
581579 return false ;
@@ -595,8 +593,8 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
595593 if (subtype_hint_string == " NodePath" ) {
596594 return true ;
597595 } else {
598- for (int j = 0 ; j < subtype_hint_string.get_slice_count (" ," ); j++ ) {
599- String ast = subtype_hint_string. get_slice ( " , " , j) .strip_edges ();
596+ for (String ast : subtype_hint_string.split (" ," )) {
597+ ast = ast .strip_edges ();
600598 allowed_subtype_array.append (ast);
601599 }
602600 }
@@ -645,8 +643,6 @@ bool EditorPropertyArray::can_drop_data_fw(const Point2 &p_point, const Variant
645643}
646644
647645void EditorPropertyArray::drop_data_fw (const Point2 &p_point, const Variant &p_data, Control *p_from) {
648- ERR_FAIL_COND (!_is_drop_valid (p_data));
649-
650646 Dictionary drag_data = p_data;
651647 const String drop_type = drag_data.get (" type" , " " );
652648 Variant array = object->get_array ();
0 commit comments