summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2016-12-14 14:57:00 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-12-20 08:30:39 -0800
commit3dcff6c3e11caa454893f44a300a3be0120325a3 (patch)
tree0af0743911663986f50ee0236c785d2395ad3f94
parent3032a67a53c02ab3b4281656456e6d62372c080f (diff)
downloadqtlocation-mapboxgl-3dcff6c3e11caa454893f44a300a3be0120325a3.tar.gz
[core] const correctness
-rw-r--r--src/mbgl/layout/symbol_layout.cpp4
-rw-r--r--src/mbgl/layout/symbol_layout.hpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp
index 7dad5c9429..2b7b41b8c9 100644
--- a/src/mbgl/layout/symbol_layout.cpp
+++ b/src/mbgl/layout/symbol_layout.cpp
@@ -311,12 +311,12 @@ void SymbolLayout::addFeature(const GeometryCollection &lines,
}
}
-bool SymbolLayout::anchorIsTooClose(const std::u16string &text, const float repeatDistance, Anchor &anchor) {
+bool SymbolLayout::anchorIsTooClose(const std::u16string& text, const float repeatDistance, const Anchor& anchor) {
if (compareText.find(text) == compareText.end()) {
compareText.emplace(text, Anchors());
} else {
auto otherAnchors = compareText.find(text)->second;
- for (Anchor &otherAnchor : otherAnchors) {
+ for (const Anchor& otherAnchor : otherAnchors) {
if (util::dist<float>(anchor.point, otherAnchor.point) < repeatDistance) {
return true;
}
diff --git a/src/mbgl/layout/symbol_layout.hpp b/src/mbgl/layout/symbol_layout.hpp
index a9a2578950..faed2de2a0 100644
--- a/src/mbgl/layout/symbol_layout.hpp
+++ b/src/mbgl/layout/symbol_layout.hpp
@@ -65,7 +65,7 @@ private:
const GlyphPositions& face,
const size_t index);
- bool anchorIsTooClose(const std::u16string& text, const float repeatDistance, Anchor&);
+ bool anchorIsTooClose(const std::u16string& text, const float repeatDistance, const Anchor&);
std::map<std::u16string, std::vector<Anchor>> compareText;
void addToDebugBuffers(CollisionTile&, SymbolBucket&);