[core] const correctness
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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&);
|
||||
|
||||
Reference in New Issue
Block a user