From 8c8645e6ae62c8b07ac82e8c8f3d1412e535074b Mon Sep 17 00:00:00 2001 From: Jaswant Panchumarti <jaswant.panchumarti@kitware.com> Date: Fri, 9 Aug 2024 11:16:27 -0400 Subject: [PATCH] Use erase-remove-if idiom correctly to remove range of BGLs - also resolves compiler warning -Wunused-result --- .../vtkWebGPUComputePassTextureStorageInternals.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Rendering/WebGPU/Private/vtkWebGPUComputePassTextureStorageInternals.cxx b/Rendering/WebGPU/Private/vtkWebGPUComputePassTextureStorageInternals.cxx index fc7979fc0d6..ab12f64e56c 100644 --- a/Rendering/WebGPU/Private/vtkWebGPUComputePassTextureStorageInternals.cxx +++ b/Rendering/WebGPU/Private/vtkWebGPUComputePassTextureStorageInternals.cxx @@ -733,8 +733,11 @@ void vtkWebGPUComputePassTextureStorageInternals::DeleteTextureViews(std::size_t std::vector<wgpu::BindGroupLayoutEntry>& bglLayoutEntries = find->second; // Now removing the bind group layout entry that corresponded to the texture view - std::remove_if(bglLayoutEntries.begin(), bglLayoutEntries.end(), - [binding](wgpu::BindGroupLayoutEntry entry) { return entry.binding == binding; }); + bglLayoutEntries.erase(std::remove_if(bglLayoutEntries.begin(), bglLayoutEntries.end(), + [binding](const wgpu::BindGroupLayoutEntry& entry) -> bool { + return entry.binding == binding; + }), + bglLayoutEntries.end()); } } -- GitLab