diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-20 12:38:09 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-23 12:09:09 +0200 |
commit | d15b9c1f9c1afa29175ba2e398adc680e66147e6 (patch) | |
tree | 6bf426ae77d7386a6bbdee30444974bbc5dd76d0 /src/mbgl/text | |
parent | 37802eec36aae3cb84c7f73a48652d9959489243 (diff) | |
download | qtlocation-mapboxgl-d15b9c1f9c1afa29175ba2e398adc680e66147e6.tar.gz |
[core] Fix performance-unnecessary-value-param errors
As reported by clang-tidy-8.
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/collision_index.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/text/collision_index.hpp | 4 | ||||
-rw-r--r-- | src/mbgl/text/glyph_manager.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/text/local_glyph_rasterizer.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/text/tagged_string.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/text/tagged_string.hpp | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/mbgl/text/collision_index.cpp b/src/mbgl/text/collision_index.cpp index 0447886166..20cb6514b6 100644 --- a/src/mbgl/text/collision_index.cpp +++ b/src/mbgl/text/collision_index.cpp @@ -126,7 +126,7 @@ std::pair<bool, bool> CollisionIndex::placeFeature( const bool pitchWithMap, const bool collisionDebug, const optional<CollisionBoundaries>& avoidEdges, - const optional<std::function<bool(const IndexedSubfeature&)>> collisionGroupPredicate, + const optional<std::function<bool(const IndexedSubfeature&)>>& collisionGroupPredicate, std::vector<ProjectedCollisionBox>& projectedBoxes) { assert(projectedBoxes.empty()); if (!feature.alongLine) { @@ -157,7 +157,7 @@ std::pair<bool, bool> CollisionIndex::placeLineFeature( const bool pitchWithMap, const bool collisionDebug, const optional<CollisionBoundaries>& avoidEdges, - const optional<std::function<bool(const IndexedSubfeature&)>> collisionGroupPredicate, + const optional<std::function<bool(const IndexedSubfeature&)>>& collisionGroupPredicate, std::vector<ProjectedCollisionBox>& projectedBoxes) { assert(feature.alongLine); assert(projectedBoxes.empty()); diff --git a/src/mbgl/text/collision_index.hpp b/src/mbgl/text/collision_index.hpp index 2effe452d9..dd1da03bdb 100644 --- a/src/mbgl/text/collision_index.hpp +++ b/src/mbgl/text/collision_index.hpp @@ -39,7 +39,7 @@ public: const bool pitchWithMap, const bool collisionDebug, const optional<CollisionBoundaries>& avoidEdges, - const optional<std::function<bool(const IndexedSubfeature&)>> collisionGroupPredicate, + const optional<std::function<bool(const IndexedSubfeature&)>>& collisionGroupPredicate, std::vector<ProjectedCollisionBox>& /*out*/); void insertFeature(const CollisionFeature& feature, const std::vector<ProjectedCollisionBox>&, bool ignorePlacement, uint32_t bucketInstanceId, uint16_t collisionGroupId); @@ -68,7 +68,7 @@ private: const bool pitchWithMap, const bool collisionDebug, const optional<CollisionBoundaries>& avoidEdges, - const optional<std::function<bool(const IndexedSubfeature&)>> collisionGroupPredicate, + const optional<std::function<bool(const IndexedSubfeature&)>>& collisionGroupPredicate, std::vector<ProjectedCollisionBox>& /*out*/); float approximateTileDistance(const TileDistance& tileDistance, const float lastSegmentAngle, const float pixelsToTileUnits, const float cameraToAnchorDistance, const bool pitchWithMap); diff --git a/src/mbgl/text/glyph_manager.cpp b/src/mbgl/text/glyph_manager.cpp index 8caac1be31..8aa9063ea5 100644 --- a/src/mbgl/text/glyph_manager.cpp +++ b/src/mbgl/text/glyph_manager.cpp @@ -70,9 +70,9 @@ void GlyphManager::requestRange(GlyphRequest& request, const FontStack& fontStac return; } - request.req = fileSource.request(Resource::glyphs(glyphURL, fontStack, range), [this, fontStack, range](Response res) { - processResponse(res, fontStack, range); - }); + request.req = + fileSource.request(Resource::glyphs(glyphURL, fontStack, range), + [this, fontStack, range](const Response& res) { processResponse(res, fontStack, range); }); } void GlyphManager::processResponse(const Response& res, const FontStack& fontStack, const GlyphRange& range) { diff --git a/src/mbgl/text/local_glyph_rasterizer.hpp b/src/mbgl/text/local_glyph_rasterizer.hpp index 82b16b534d..4582aab103 100644 --- a/src/mbgl/text/local_glyph_rasterizer.hpp +++ b/src/mbgl/text/local_glyph_rasterizer.hpp @@ -33,7 +33,7 @@ namespace mbgl { class LocalGlyphRasterizer { public: virtual ~LocalGlyphRasterizer(); - LocalGlyphRasterizer(const optional<std::string> fontFamily = optional<std::string>()); + LocalGlyphRasterizer(const optional<std::string>& fontFamily = optional<std::string>()); // virtual so that test harness can override platform-specific behavior virtual bool canRasterizeGlyph(const FontStack&, GlyphID); diff --git a/src/mbgl/text/tagged_string.cpp b/src/mbgl/text/tagged_string.cpp index 83ccd610c2..b18ad4d148 100644 --- a/src/mbgl/text/tagged_string.cpp +++ b/src/mbgl/text/tagged_string.cpp @@ -12,7 +12,7 @@ namespace mbgl { void TaggedString::addTextSection(const std::u16string& sectionText, double scale, - FontStack fontStack, + const FontStack& fontStack, optional<Color> textColor) { styledText.first += sectionText; sections.emplace_back(scale, fontStack, std::move(textColor)); diff --git a/src/mbgl/text/tagged_string.hpp b/src/mbgl/text/tagged_string.hpp index fba3bbf412..205bfbcc53 100644 --- a/src/mbgl/text/tagged_string.hpp +++ b/src/mbgl/text/tagged_string.hpp @@ -82,7 +82,7 @@ struct TaggedString { void addTextSection(const std::u16string& text, double scale, - FontStack fontStack, + const FontStack& fontStack, optional<Color> textColor_ = nullopt); void addImageSection(const std::string& imageID); |