summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-01-21 12:16:40 +0200
committerGali Nelle <galinelle.mapbox@gmail.com>2020-01-21 13:24:12 +0200
commit7c002503acc1c315004a1095ca7ffef2693c3e5c (patch)
tree798cf0e2f11e1d980ed43b48eda0a5a4eb91f109
parent6ddff19ceedb8f6cb095792b90121330afcc38cf (diff)
downloadqtlocation-mapboxgl-upstream/remove_array_copy.tar.gz
[core] remove std::vector copy step in SymbolLayout::anchorIsTooCloseupstream/remove_array_copy
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 499f1113cc..4aedd224a2 100644
--- a/src/mbgl/layout/symbol_layout.cpp
+++ b/src/mbgl/layout/symbol_layout.cpp
@@ -680,7 +680,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;