From 4678b3d70cf36b4bd2668251b7f3deb6ca33c555 Mon Sep 17 00:00:00 2001 From: galinelle <59386712+galinelle@users.noreply.github.com> Date: Wed, 22 Jan 2020 16:04:31 +0200 Subject: [PATCH] [core] remove std::vector copy step in SymbolLayout::anchorIsTooClose (#16131) A const reference is enough here. --- src/mbgl/layout/symbol_layout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 1f447ddc9..e0475f0ac 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -682,7 +682,7 @@ bool SymbolLayout::anchorIsTooClose(const std::u16string& text, const float repe if (compareText.find(text) == compareText.end()) { compareText.emplace(text, Anchors()); } else { - auto otherAnchors = compareText.find(text)->second; + const auto& otherAnchors = compareText.find(text)->second; for (const Anchor& otherAnchor : otherAnchors) { if (util::dist(anchor.point, otherAnchor.point) < repeatDistance) { return true;