diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-06-27 01:05:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-27 01:05:18 +0200 |
commit | eaaff9da3178fa515a0f051fda932c1dd04d53db (patch) | |
tree | 56173535c376e0324f89baccf4bc14b2580ead23 /editor/editor_file_system.cpp | |
parent | d8c96461183f0dc3208c3d624674fa4544212ea5 (diff) | |
parent | 4e5310cc60dc17e5ef09e57115ca8236544679e4 (diff) | |
download | redot-engine-eaaff9da3178fa515a0f051fda932c1dd04d53db.tar.gz |
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r-- | editor/editor_file_system.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 4ddb28b440..3c7c6ec9ed 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1290,13 +1290,7 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector r_file_pos = cpos; *r_d = fs; - if (cpos != -1) { - - return true; - } else { - - return false; - } + return cpos != -1; } String EditorFileSystem::get_file_type(const String &p_file) const { @@ -1604,7 +1598,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector //all went well, overwrite config files with proper remaps and md5s for (Map<String, Map<StringName, Variant> >::Element *E = source_file_options.front(); E; E = E->next()) { - String file = E->key(); + const String &file = E->key(); String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(file); FileAccessRef f = FileAccess::open(file + ".import", FileAccess::WRITE); ERR_FAIL_COND_V(!f, ERR_FILE_CANT_OPEN); @@ -1939,7 +1933,7 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) { if (err) { memdelete(da); ERR_EXPLAIN("Failed to create 'res://.import' folder."); - ERR_FAIL_COND(err != OK); + ERR_FAIL(); } } memdelete(da); |