From b4e15b28b6caf4b3fbd254beba422304f0d61695 Mon Sep 17 00:00:00 2001 From: Yifan Zhu Date: Fri, 29 Mar 2024 07:52:18 -0700 Subject: [PATCH] plugins/mousemark: correct reserve size. verts is now QVector. So don't reserve 2x the size. This ammends commit 617f3b9000efd7cd709f00779168e4cd9cfaecf5. --- src/plugins/mousemark/mousemark.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/mousemark/mousemark.cpp b/src/plugins/mousemark/mousemark.cpp index 5ded2aa8ba..ff5d79e710 100644 --- a/src/plugins/mousemark/mousemark.cpp +++ b/src/plugins/mousemark/mousemark.cpp @@ -125,7 +125,7 @@ void MouseMarkEffect::paintScreen(const RenderTarget &renderTarget, const Render QList verts; for (const Mark &mark : std::as_const(marks)) { verts.clear(); - verts.reserve(mark.size() * 2); + verts.reserve(mark.size()); for (const QPointF &p : std::as_const(mark)) { verts.push_back(QVector2D(p.x() * scale, p.y() * scale)); } @@ -134,7 +134,7 @@ void MouseMarkEffect::paintScreen(const RenderTarget &renderTarget, const Render } if (!drawing.isEmpty()) { verts.clear(); - verts.reserve(drawing.size() * 2); + verts.reserve(drawing.size()); for (const QPointF &p : std::as_const(drawing)) { verts.push_back(QVector2D(p.x() * scale, p.y() * scale)); }