Skip to content

Commit

Permalink
Use "const Vector &" in a predicate
Browse files Browse the repository at this point in the history
Could help with compiler optimizations and thus performance.
  • Loading branch information
ruevs committed Sep 20, 2024
1 parent da2ed88 commit d02a915
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void GraphicsWindow::Selection::Draw(bool isHovered, Canvas *canvas) {
Vector topLeft = camera.UnProjectPoint(topLeftScreen);

auto it = std::unique(refs.begin(), refs.end(),
[](Vector a, Vector b) { return a.Equals(b); });
[](const Vector &a, const Vector &b) { return a.Equals(b); });
refs.erase(it, refs.end());
for(const Vector &p : refs) {
canvas->DrawLine(topLeft, p, hcsEmphasis);
Expand Down

0 comments on commit d02a915

Please sign in to comment.