summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgalinelle <59386712+galinelle@users.noreply.github.com>2020-01-22 16:04:31 +0200
committerGitHub <noreply@github.com>2020-01-22 16:04:31 +0200
commit4678b3d70cf36b4bd2668251b7f3deb6ca33c555 (patch)
treec6f90b86e5a0b7792cf2f7ffeb98066ba32e080b
parent04edb1dbaa1c660f830f80275dc25dc700d29f1a (diff)
downloadqtlocation-mapboxgl-4678b3d70cf36b4bd2668251b7f3deb6ca33c555.tar.gz
[core] remove std::vector copy step in SymbolLayout::anchorIsTooClose (#16131)
A const reference is enough here.
-rw-r--r--src/mbgl/layout/symbol_layout.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp
index 1f447ddc9f..e0475f0acb 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<float>(anchor.point, otherAnchor.point) < repeatDistance) {
return true;