[core] Fix performance-for-range-copy errors
As reported by clang-tidy-8.
This commit is contained in:
@@ -501,7 +501,7 @@ void RenderOrchestrator::queryRenderedSymbols(std::unordered_map<std::string, st
|
||||
const Placement& placement = *placementController.getPlacement();
|
||||
auto renderedSymbols = placement.getCollisionIndex().queryRenderedSymbols(geometry);
|
||||
std::vector<std::reference_wrapper<const RetainedQueryData>> bucketQueryData;
|
||||
for (auto entry : renderedSymbols) {
|
||||
for (const auto& entry : renderedSymbols) {
|
||||
bucketQueryData.emplace_back(placement.getQueryData(entry.first));
|
||||
}
|
||||
// Although symbol query is global, symbol results are only sortable within a bucket
|
||||
|
||||
@@ -69,7 +69,7 @@ ParseResult Let::parse(const Convertible& value, ParsingContext& ctx) {
|
||||
mbgl::Value Let::serialize() const {
|
||||
std::vector<mbgl::Value> serialized;
|
||||
serialized.emplace_back(getOperator());
|
||||
for (auto entry : bindings) {
|
||||
for (const auto& entry : bindings) {
|
||||
serialized.emplace_back(entry.first);
|
||||
serialized.emplace_back(entry.second->serialize());
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ bool CrossTileSymbolLayerIndex::addBucket(const OverscaledTileID& tileID,
|
||||
}
|
||||
|
||||
void CrossTileSymbolLayerIndex::removeBucketCrossTileIDs(uint8_t zoom, const TileLayerIndex& removedBucket) {
|
||||
for (auto key : removedBucket.indexedSymbolInstances) {
|
||||
for (const auto& key : removedBucket.indexedSymbolInstances) {
|
||||
for (auto indexedSymbolInstance : key.second) {
|
||||
usedCrossTileIDs[zoom].erase(indexedSymbolInstance.crossTileID);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ void GeometryTile::querySourceFeatures(
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto sourceLayer : *options.sourceLayers) {
|
||||
for (const auto& sourceLayer : *options.sourceLayers) {
|
||||
// Go throught all sourceLayers, if any
|
||||
// to gather all the features
|
||||
auto layer = getData()->getLayer(sourceLayer);
|
||||
|
||||
@@ -214,7 +214,7 @@ GeometryCollection convertGeometry(const Feature::geometry_type& geometryTileFea
|
||||
[&](const MultiLineString<double>& lineStrings) -> GeometryCollection {
|
||||
GeometryCollection result;
|
||||
result.reserve(lineStrings.size());
|
||||
for (const auto line : lineStrings) {
|
||||
for (const auto& line : lineStrings) {
|
||||
LineString<int16_t> temp;
|
||||
temp.reserve(line.size());
|
||||
for (const auto p : line) {
|
||||
@@ -227,7 +227,7 @@ GeometryCollection convertGeometry(const Feature::geometry_type& geometryTileFea
|
||||
[&](const Polygon<double> polygon) -> GeometryCollection {
|
||||
GeometryCollection result;
|
||||
result.reserve(polygon.size());
|
||||
for (const auto ring : polygon) {
|
||||
for (const auto& ring : polygon) {
|
||||
LinearRing<int16_t> temp;
|
||||
temp.reserve(ring.size());
|
||||
for (const auto p : ring) {
|
||||
@@ -240,8 +240,8 @@ GeometryCollection convertGeometry(const Feature::geometry_type& geometryTileFea
|
||||
[&](const MultiPolygon<double> polygons) -> GeometryCollection {
|
||||
GeometryCollection result;
|
||||
result.reserve(polygons.size());
|
||||
for (const auto pg : polygons) {
|
||||
for (const auto r : pg) {
|
||||
for (const auto& pg : polygons) {
|
||||
for (const auto& r : pg) {
|
||||
LinearRing<int16_t> ring;
|
||||
ring.reserve(r.size());
|
||||
for (const auto p : r) {
|
||||
|
||||
Reference in New Issue
Block a user