diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-08-07 12:54:30 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-08-07 12:54:30 +0200 |
commit | e0b5b218638df5b7b2998233182a7d8a1118e717 (patch) | |
tree | 0de2f04fbb41472d3bd9b43141f26193cb062be9 /core/io | |
parent | 045ab51ae50139e645958149c6d6d354026ccdd4 (diff) |
Add some code changes/fixes proposed by Coverity and Clang Tidy
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/resource_loader.cpp | 3 | ||||
-rw-r--r-- | core/io/resource_saver.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index a29b9d1ddb..35af58ad07 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -940,8 +940,7 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) { ERR_EXPLAIN("Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt)); ERR_FAIL_COND_V(obj == NULL, false); - ResourceFormatLoader *crl = NULL; - crl = Object::cast_to<ResourceFormatLoader>(obj); + ResourceFormatLoader *crl = Object::cast_to<ResourceFormatLoader>(obj); crl->set_script(s.get_ref_ptr()); ResourceLoader::add_resource_format_loader(crl); diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index e2c1c3402a..369cd93442 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -222,8 +222,7 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) { ERR_EXPLAIN("Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt)); ERR_FAIL_COND_V(obj == NULL, false); - ResourceFormatSaver *crl = NULL; - crl = Object::cast_to<ResourceFormatSaver>(obj); + ResourceFormatSaver *crl = Object::cast_to<ResourceFormatSaver>(obj); crl->set_script(s.get_ref_ptr()); ResourceSaver::add_resource_format_saver(crl); |