diff options
author | Anilforextra <anilforextra@gmail.com> | 2022-02-02 00:04:13 +0545 |
---|---|---|
committer | Anilforextra <anilforextra@gmail.com> | 2022-02-02 00:11:09 +0545 |
commit | fc27636999a15f88b1f3b1d7101d84a67968ba06 (patch) | |
tree | e3b66fce3dfd70ef1e7d5a4d1543446af2deae47 /servers/rendering/renderer_rd | |
parent | ea12094f19b028c1dcf6d402b8cbb3296b2065a8 (diff) |
Vectors: Use clear() and has().
Use clear() instead of resize(0).
Use has() instead of "find(p_val) != -1".
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_scene_render_rd.cpp | 4 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index 7a50fd0e59..43a1812f89 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -925,7 +925,7 @@ void RendererSceneRenderRD::shadow_atlas_set_size(RID p_atlas, int p_size, bool } for (int i = 0; i < 4; i++) { //clear subdivisions - shadow_atlas->quadrants[i].shadows.resize(0); + shadow_atlas->quadrants[i].shadows.clear(); shadow_atlas->quadrants[i].shadows.resize(1 << shadow_atlas->quadrants[i].subdivision); } @@ -972,7 +972,7 @@ void RendererSceneRenderRD::shadow_atlas_set_quadrant_subdivision(RID p_atlas, i } } - shadow_atlas->quadrants[p_quadrant].shadows.resize(0); + shadow_atlas->quadrants[p_quadrant].shadows.clear(); shadow_atlas->quadrants[p_quadrant].shadows.resize(subdiv * subdiv); shadow_atlas->quadrants[p_quadrant].subdivision = subdiv; diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 2e63ac57d9..145c4f902e 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -6238,7 +6238,7 @@ void RendererStorageRD::skeleton_allocate_data(RID p_skeleton, int p_bones, bool if (skeleton->buffer.is_valid()) { RD::get_singleton()->free(skeleton->buffer); skeleton->buffer = RID(); - skeleton->data.resize(0); + skeleton->data.clear(); skeleton->uniform_set_mi = RID(); } |