diff options
author | Gali Nelle <galinelle.mapbox@gmail.com> | 2020-01-21 12:16:40 +0200 |
---|---|---|
committer | Gali Nelle <galinelle.mapbox@gmail.com> | 2020-01-21 13:24:12 +0200 |
commit | 7c002503acc1c315004a1095ca7ffef2693c3e5c (patch) | |
tree | 798cf0e2f11e1d980ed43b48eda0a5a4eb91f109 | |
parent | 6ddff19ceedb8f6cb095792b90121330afcc38cf (diff) | |
download | qtlocation-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.cpp | 2 |
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; |