[core] Fix modernize-pass-by-value errors in header files

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-27 18:30:35 +02:00
parent ee2eb13a55
commit 83b43bb38c
3 changed files with 12 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
#include <mbgl/util/geometry.hpp>
#include <mbgl/util/optional.hpp>
#include <utility>
#include <vector>
namespace mbgl {
@@ -14,7 +14,7 @@ public:
optional<std::size_t> segment;
Anchor(float x_, float y_, float angle_, optional<std::size_t> segment_ = nullopt)
: point(x_, y_), angle(angle_), segment(segment_) {}
: point(x_, y_), angle(angle_), segment(std::move(segment_)) {}
};
using Anchors = std::vector<Anchor>;

View File

@@ -5,6 +5,7 @@
#include <cassert>
#include <memory>
#include <string>
#include <utility>
#include <vector>
namespace mbgl {
@@ -29,18 +30,16 @@ using RenderItems = std::vector<std::reference_wrapper<const RenderItem>>;
class RenderTreeParameters {
public:
explicit RenderTreeParameters(
const TransformState& state_,
MapMode mapMode_,
MapDebugOptions debugOptions_,
TimePoint timePoint_,
const EvaluatedLight& light_)
explicit RenderTreeParameters(const TransformState& state_,
MapMode mapMode_,
MapDebugOptions debugOptions_,
TimePoint timePoint_,
EvaluatedLight light_)
: transformParams(state_),
mapMode(mapMode_),
debugOptions(debugOptions_),
timePoint(timePoint_),
light(light_) {
}
light(std::move(light_)) {}
TransformParameters transformParams;
MapMode mapMode;
MapDebugOptions debugOptions;

View File

@@ -7,6 +7,8 @@
#include <mbgl/text/glyph_atlas.hpp>
#include <mbgl/text/tagged_string.hpp>
#include <utility>
namespace mbgl {
struct AnchorAlignment {
@@ -44,7 +46,7 @@ class PositionedIcon {
private:
PositionedIcon(
ImagePosition image_, float top_, float bottom_, float left_, float right_, const Padding& collisionPadding_)
: _image(image_),
: _image(std::move(image_)),
_top(top_),
_bottom(bottom_),
_left(left_),