diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-10-07 10:58:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-07 10:58:45 +0200 |
commit | 44d82b3a070b7ed8973d9e8bc6e58da1084fc7d1 (patch) | |
tree | 544ab66de3ef4c6a20f2739decc4e98212c3207a /editor | |
parent | c27b2adb10ea7077008d4f8b356e3561d05bad6a (diff) | |
parent | 4f7b33cdcfdcbc11bcc506018dff1b06db3cf3f6 (diff) |
Merge pull request #22752 from aaronfranke/equals-redundant
Remove redundant "== true" and "== false" code
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 2 | ||||
-rw-r--r-- | editor/editor_profiler.cpp | 2 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 12 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/project_export.cpp | 6 |
7 files changed, 14 insertions, 14 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 38bdba31ea..f425d0a995 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -501,7 +501,7 @@ void EditorFileDialog::_items_clear_selection() { case MODE_OPEN_FILE: case MODE_OPEN_FILES: get_ok()->set_text(TTR("Open")); - get_ok()->set_disabled(item_list->is_anything_selected() == false); + get_ok()->set_disabled(!item_list->is_anything_selected()); break; case MODE_OPEN_DIR: diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 790e38afca..fda6457e26 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3889,7 +3889,7 @@ void EditorNode::_scene_tab_closed(int p_tab) { } void EditorNode::_scene_tab_hover(int p_tab) { - if (bool(EDITOR_GET("interface/scene_tabs/show_thumbnail_on_hover")) == false) { + if (!bool(EDITOR_GET("interface/scene_tabs/show_thumbnail_on_hover"))) { return; } int current_tab = scene_tabs->get_current_tab(); diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp index b57e3826c6..d3978749c0 100644 --- a/editor/editor_profiler.cpp +++ b/editor/editor_profiler.cpp @@ -257,7 +257,7 @@ void EditorProfiler::_update_plot() { //get const Metric &m = frame_metrics[idx]; - if (m.valid == false) + if (!m.valid) continue; //skip because invalid float value = 0; diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index a6b754de3b..cb15be35f2 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1793,22 +1793,22 @@ template <> struct EditorSceneImporterGLTFInterpolate<Quat> { Quat lerp(const Quat &a, const Quat &b, float c) const { - ERR_FAIL_COND_V(a.is_normalized() == false, Quat()); - ERR_FAIL_COND_V(b.is_normalized() == false, Quat()); + ERR_FAIL_COND_V(!a.is_normalized(), Quat()); + ERR_FAIL_COND_V(!b.is_normalized(), Quat()); return a.slerp(b, c).normalized(); } Quat catmull_rom(const Quat &p0, const Quat &p1, const Quat &p2, const Quat &p3, float c) { - ERR_FAIL_COND_V(p1.is_normalized() == false, Quat()); - ERR_FAIL_COND_V(p2.is_normalized() == false, Quat()); + ERR_FAIL_COND_V(!p1.is_normalized(), Quat()); + ERR_FAIL_COND_V(!p2.is_normalized(), Quat()); return p1.slerp(p2, c).normalized(); } Quat bezier(Quat start, Quat control_1, Quat control_2, Quat end, float t) { - ERR_FAIL_COND_V(start.is_normalized() == false, Quat()); - ERR_FAIL_COND_V(end.is_normalized() == false, Quat()); + ERR_FAIL_COND_V(!start.is_normalized(), Quat()); + ERR_FAIL_COND_V(!end.is_normalized(), Quat()); return start.slerp(end, t).normalized(); } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index e8f00ce0ba..a9bc5e77ac 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5113,7 +5113,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Varian type == "AtlasTexture" || type == "LargeTexture") { Ref<Texture> texture = Ref<Texture>(Object::cast_to<Texture>(*res)); - if (texture.is_valid() == false) { + if (!texture.is_valid()) { continue; } } else { diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index f627788171..f57614b3b3 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2124,7 +2124,7 @@ void SpatialEditorViewport::_notification(int p_what) { _update_freelook(delta); Node *scene_root = editor->get_scene_tree_dock()->get_editor_data()->get_edited_scene_root(); - if (previewing_cinema == true && scene_root != NULL) { + if (previewing_cinema && scene_root != NULL) { Camera *cam = scene_root->get_viewport()->get_camera(); if (cam != NULL && cam != previewing) { //then switch the viewport's camera to the scene's viewport camera diff --git a/editor/project_export.cpp b/editor/project_export.cpp index fa6dce1771..3ec49e187f 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -638,10 +638,10 @@ bool ProjectExportDialog::_fill_tree(EditorFileSystemDirectory *p_dir, TreeItem for (int i = 0; i < p_dir->get_subdir_count(); i++) { TreeItem *subdir = include_files->create_item(p_item); - if (_fill_tree(p_dir->get_subdir(i), subdir, current, p_only_scenes) == false) { - memdelete(subdir); - } else { + if (_fill_tree(p_dir->get_subdir(i), subdir, current, p_only_scenes)) { used = true; + } else { + memdelete(subdir); } } |