[core] const correctness

This commit is contained in:
John Firebaugh
2016-12-14 14:57:00 -08:00
parent 3032a67a53
commit 3dcff6c3e1
2 changed files with 3 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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&);