[core] Fix performance-move-const-arg
This commit is contained in:
@@ -16,9 +16,7 @@ using AnnotationIDs = std::vector<AnnotationID>;
|
||||
|
||||
class SymbolAnnotation {
|
||||
public:
|
||||
SymbolAnnotation(Point<double> geometry_, std::string icon_ = {})
|
||||
: geometry(std::move(geometry_)),
|
||||
icon(std::move(icon_)) {}
|
||||
SymbolAnnotation(Point<double> geometry_, std::string icon_ = {}) : geometry(geometry_), icon(std::move(icon_)) {}
|
||||
|
||||
Point<double> geometry;
|
||||
std::string icon;
|
||||
|
||||
@@ -12,12 +12,12 @@ class Mailbox;
|
||||
|
||||
class ResourceTransform {
|
||||
public:
|
||||
using TransformCallback = std::function<std::string(Resource::Kind kind, const std::string&& url)>;
|
||||
using TransformCallback = std::function<std::string(Resource::Kind kind, const std::string& url)>;
|
||||
using FinishedCallback = std::function<void(const std::string&&)>;
|
||||
|
||||
ResourceTransform(ActorRef<ResourceTransform>, TransformCallback&&);
|
||||
|
||||
void transform(Resource::Kind, const std::string&& url, FinishedCallback&&);
|
||||
void transform(Resource::Kind, const std::string& url, FinishedCallback&&);
|
||||
|
||||
private:
|
||||
TransformCallback transformCallback;
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
}
|
||||
|
||||
Convertible(Convertible&& v) : vtable(v.vtable) {
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
vtable->move(std::move(v.storage), storage);
|
||||
}
|
||||
|
||||
@@ -101,6 +102,7 @@ public:
|
||||
if (this != &v) {
|
||||
vtable->destroy(storage);
|
||||
vtable = v.vtable;
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
vtable->move(std::move(v.storage), storage);
|
||||
}
|
||||
return *this;
|
||||
|
||||
@@ -141,7 +141,7 @@ inline std::array<CanonicalTileID, 4> CanonicalTileID::children() const {
|
||||
}
|
||||
|
||||
inline OverscaledTileID::OverscaledTileID(uint8_t overscaledZ_, int16_t wrap_, CanonicalTileID canonical_)
|
||||
: overscaledZ(overscaledZ_), wrap(wrap_), canonical(std::move(canonical_)) {
|
||||
: overscaledZ(overscaledZ_), wrap(wrap_), canonical(canonical_) {
|
||||
assert(overscaledZ >= canonical.z);
|
||||
}
|
||||
|
||||
@@ -207,8 +207,7 @@ inline UnwrappedTileID::UnwrappedTileID(uint8_t z_, int64_t x_, int64_t y_)
|
||||
}
|
||||
|
||||
inline UnwrappedTileID::UnwrappedTileID(int16_t wrap_, CanonicalTileID canonical_)
|
||||
: wrap(wrap_), canonical(std::move(canonical_)) {
|
||||
}
|
||||
: wrap(wrap_), canonical(canonical_) {}
|
||||
|
||||
inline bool UnwrappedTileID::operator==(const UnwrappedTileID& rhs) const {
|
||||
return wrap == rhs.wrap && canonical == rhs.canonical;
|
||||
|
||||
@@ -170,8 +170,7 @@ private:
|
||||
LatLng ne;
|
||||
bool bounded = true;
|
||||
|
||||
LatLngBounds(LatLng sw_, LatLng ne_)
|
||||
: sw(std::move(sw_)), ne(std::move(ne_)) {}
|
||||
LatLngBounds(LatLng sw_, LatLng ne_) : sw(sw_), ne(ne_) {}
|
||||
|
||||
LatLngBounds()
|
||||
: sw({-90, -180}), ne({90, 180}), bounded(false) {}
|
||||
|
||||
@@ -22,12 +22,9 @@ class Image : private util::noncopyable {
|
||||
public:
|
||||
Image() = default;
|
||||
|
||||
Image(Size size_)
|
||||
: size(std::move(size_)),
|
||||
data(std::make_unique<uint8_t[]>(bytes())) {}
|
||||
Image(Size size_) : size(size_), data(std::make_unique<uint8_t[]>(bytes())) {}
|
||||
|
||||
Image(Size size_, const uint8_t* srcData, std::size_t srcLength)
|
||||
: size(std::move(size_)) {
|
||||
Image(Size size_, const uint8_t* srcData, std::size_t srcLength) : size(size_) {
|
||||
if (srcLength != bytes()) {
|
||||
throw std::invalid_argument("mismatched image size");
|
||||
}
|
||||
@@ -35,9 +32,7 @@ public:
|
||||
std::copy(srcData, srcData + srcLength, data.get());
|
||||
}
|
||||
|
||||
Image(Size size_, std::unique_ptr<uint8_t[]> data_)
|
||||
: size(std::move(size_)),
|
||||
data(std::move(data_)) {}
|
||||
Image(Size size_, std::unique_ptr<uint8_t[]> data_) : size(size_), data(std::move(data_)) {}
|
||||
|
||||
Image(Image&& o)
|
||||
: size(o.size),
|
||||
|
||||
@@ -24,18 +24,17 @@ public:
|
||||
DEMEncoding encoding;
|
||||
optional<LatLngBounds> bounds;
|
||||
|
||||
|
||||
Tileset(std::vector<std::string> tiles_ = std::vector<std::string>(),
|
||||
Range<uint8_t> zoomRange_ = { 0, util::DEFAULT_MAX_ZOOM },
|
||||
Range<uint8_t> zoomRange_ = {0, util::DEFAULT_MAX_ZOOM},
|
||||
std::string attribution_ = {},
|
||||
Scheme scheme_ = Scheme::XYZ,
|
||||
DEMEncoding encoding_ = DEMEncoding::Mapbox)
|
||||
: tiles(std::move(tiles_)),
|
||||
zoomRange(std::move(zoomRange_)),
|
||||
zoomRange(zoomRange_),
|
||||
attribution(std::move(attribution_)),
|
||||
scheme(scheme_),
|
||||
encoding(encoding_),
|
||||
bounds() {};
|
||||
bounds(){};
|
||||
|
||||
// TileJSON also includes center and zoom but they are not used by mbgl.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user