summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAurélien Brooke <aurelien@bahiasoft.fr>2022-12-20 21:33:25 +0100
committerAurélien Brooke <aurelien@bahiasoft.fr>2022-12-21 17:31:36 +0100
commitc4eb65588681f5d704e21c3a805a2e481ef2cbe5 (patch)
treebade70b6319b3e3fc0e58e34c0607b509687be89 /src
parentb291ef7442453d3ea842756189413d9521029b1b (diff)
OpenGLVertexArrayObject: fix bugprone erase() call
openglvertexarrayobject.cpp:117:5: this call will remove at most one item even when multiple items should be removed [bugprone-inaccurate- erase] Change-Id: Ife88facc1cad159658c08180548fe365eaeb1714 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp
index 44badbad5..6f3f7b259 100644
--- a/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp
+++ b/src/plugins/renderers/opengl/renderer/openglvertexarrayobject.cpp
@@ -116,9 +116,10 @@ void OpenGLVertexArrayObject::saveVertexAttribute(const SubmissionContext::VAOVe
// Remove any vertexAttribute already at location
m_vertexAttributes.erase(std::remove_if(m_vertexAttributes.begin(),
m_vertexAttributes.end(),
- [attr] (const SubmissionContext::VAOVertexAttribute &a) {
- return a.location == attr.location;
- }));
+ [attr](const SubmissionContext::VAOVertexAttribute &a) {
+ return a.location == attr.location;
+ }),
+ m_vertexAttributes.end());
m_vertexAttributes.push_back(attr);
}