[tidy] Check modernize-pass-by-value
Ref: http://clang.llvm.org/extra/clang-tidy/checks/modernize-pass-by-value.html
This commit is contained in:
@@ -27,7 +27,7 @@ class Tileset;
|
||||
*/
|
||||
class OfflineTilePyramidRegionDefinition {
|
||||
public:
|
||||
OfflineTilePyramidRegionDefinition(const std::string&, const LatLngBounds&, double, double, float);
|
||||
OfflineTilePyramidRegionDefinition(std::string, LatLngBounds, double, double, float);
|
||||
|
||||
/* Private */
|
||||
std::vector<CanonicalTileID> tileCover(SourceType, uint16_t tileSize, const Tileset&) const;
|
||||
@@ -200,8 +200,8 @@ private:
|
||||
friend class OfflineDatabase;
|
||||
|
||||
OfflineRegion(int64_t id,
|
||||
const OfflineRegionDefinition&,
|
||||
const OfflineRegionMetadata&);
|
||||
OfflineRegionDefinition,
|
||||
OfflineRegionMetadata);
|
||||
|
||||
const int64_t id;
|
||||
const OfflineRegionDefinition definition;
|
||||
|
||||
@@ -33,10 +33,10 @@ public:
|
||||
Required = true,
|
||||
};
|
||||
|
||||
Resource(Kind kind_, const std::string& url_, optional<TileData> tileData_ = {}, Necessity necessity_ = Required)
|
||||
Resource(Kind kind_, std::string url_, optional<TileData> tileData_ = {}, Necessity necessity_ = Required)
|
||||
: kind(kind_),
|
||||
necessity(necessity_),
|
||||
url(url_),
|
||||
url(std::move(url_)),
|
||||
tileData(std::move(tileData_)) {
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
std::string message;
|
||||
|
||||
public:
|
||||
Error(Reason, const std::string& = "");
|
||||
Error(Reason, std::string = "");
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream&, Response::Error::Reason);
|
||||
|
||||
@@ -12,8 +12,8 @@ public:
|
||||
using Stop = std::pair<float, T>;
|
||||
using Stops = std::vector<Stop>;
|
||||
|
||||
explicit Function(const Stops& stops_, float base_)
|
||||
: base(base_), stops(stops_) {}
|
||||
explicit Function(Stops stops_, float base_)
|
||||
: base(base_), stops(std::move(stops_)) {}
|
||||
|
||||
float getBase() const { return base; }
|
||||
const std::vector<std::pair<float, T>>& getStops() const { return stops; }
|
||||
|
||||
@@ -8,8 +8,8 @@ namespace style {
|
||||
|
||||
class TransitionOptions {
|
||||
public:
|
||||
TransitionOptions(const optional<Duration>& duration_ = {}, const optional<Duration>& delay_ = {})
|
||||
: duration(duration_), delay(delay_) {}
|
||||
TransitionOptions(optional<Duration> duration_ = {}, optional<Duration> delay_ = {})
|
||||
: duration(std::move(duration_)), delay(std::move(delay_)) {}
|
||||
|
||||
optional<Duration> duration;
|
||||
optional<Duration> delay;
|
||||
|
||||
@@ -161,8 +161,8 @@ private:
|
||||
LatLng sw;
|
||||
LatLng ne;
|
||||
|
||||
LatLngBounds(const LatLng& sw_, const LatLng& ne_)
|
||||
: sw(sw_), ne(ne_) {}
|
||||
LatLngBounds(LatLng sw_, LatLng ne_)
|
||||
: sw(std::move(sw_)), ne(std::move(ne_)) {}
|
||||
|
||||
friend bool operator==(const LatLngBounds&, const LatLngBounds&);
|
||||
friend bool operator!=(const LatLngBounds&, const LatLngBounds&);
|
||||
|
||||
Reference in New Issue
Block a user