[core] add std::move to constructors
This commit is contained in:
@@ -114,7 +114,7 @@ private:
|
||||
class Invoker : public WorkTask {
|
||||
public:
|
||||
Invoker(F&& f, P&& p, std::shared_ptr<std::atomic<bool>> canceled_ = nullptr)
|
||||
: canceled(canceled_),
|
||||
: canceled(std::move(canceled_)),
|
||||
func(std::move(f)),
|
||||
params(std::move(p)) {
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
#ifdef MBGL_USE_CGL
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
@@ -26,7 +27,7 @@ HeadlessView::HeadlessView(std::shared_ptr<HeadlessDisplay> display_,
|
||||
float pixelRatio_,
|
||||
uint16_t width,
|
||||
uint16_t height)
|
||||
: display(display_), pixelRatio(pixelRatio_) {
|
||||
: display(std::move(display_)), pixelRatio(pixelRatio_) {
|
||||
resize(width, height);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
#include <mbgl/util/constants.hpp>
|
||||
#include <mbgl/map/map_data.hpp>
|
||||
#include <mbgl/storage/file_source.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
AnnotationTileFeature::AnnotationTileFeature(FeatureType type_, GeometryCollection geometries_,
|
||||
std::unordered_map<std::string, std::string> properties_)
|
||||
: type(type_),
|
||||
properties(properties_),
|
||||
properties(std::move(properties_)),
|
||||
geometries(geometries_) {}
|
||||
|
||||
mapbox::util::optional<Value> AnnotationTileFeature::getValue(const std::string& key) const {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/constants.hpp>
|
||||
#include <mbgl/util/exception.hpp>
|
||||
#include <utility>
|
||||
|
||||
using namespace mbgl;
|
||||
|
||||
@@ -19,7 +20,7 @@ TileWorker::TileWorker(TileID id_,
|
||||
GlyphStore& glyphStore_,
|
||||
const std::atomic<TileData::State>& state_)
|
||||
: id(id_),
|
||||
sourceID(sourceID_),
|
||||
sourceID(std::move(sourceID_)),
|
||||
spriteStore(spriteStore_),
|
||||
glyphAtlas(glyphAtlas_),
|
||||
glyphStore(glyphStore_),
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <mbgl/util/thread_context.hpp>
|
||||
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -130,7 +131,7 @@ GeometryCollection VectorTileFeature::getGeometries() const {
|
||||
}
|
||||
|
||||
VectorTile::VectorTile(std::shared_ptr<const std::string> data_)
|
||||
: data(data_) {
|
||||
: data(std::move(data_)) {
|
||||
}
|
||||
|
||||
util::ptr<GeometryTileLayer> VectorTile::getLayer(const std::string& name) const {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -18,7 +19,7 @@ public:
|
||||
|
||||
RequestBase(const Resource& resource_, Callback notify_)
|
||||
: resource(resource_)
|
||||
, notify(notify_) {
|
||||
, notify(std::move(notify_)) {
|
||||
}
|
||||
|
||||
virtual ~RequestBase() = default;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <mbgl/style/property_parsing.hpp>
|
||||
#include <mbgl/style/function.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
@@ -13,7 +14,7 @@ using JSVal = rapidjson::Value;
|
||||
template <typename T>
|
||||
class LayoutProperty {
|
||||
public:
|
||||
LayoutProperty(T v) : value(v) {}
|
||||
LayoutProperty(T v) : value(std::move(v)) {}
|
||||
|
||||
void parse(const char * name, const JSVal& layout) {
|
||||
if (layout.HasMember(name)) {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -117,7 +118,7 @@ public:
|
||||
: prior(std::move(prior_)),
|
||||
begin(begin_),
|
||||
end(end_),
|
||||
value(value_) {
|
||||
value(std::move(value_)) {
|
||||
}
|
||||
|
||||
Result calculate(const StyleCalculationParameters& parameters) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <mbgl/util/rect.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <map>
|
||||
@@ -59,7 +60,7 @@ class Shaping {
|
||||
public:
|
||||
inline explicit Shaping() : top(0), bottom(0), left(0), right(0) {}
|
||||
inline explicit Shaping(float x, float y, std::u32string text_)
|
||||
: text(text_), top(y), bottom(y), left(x), right(x) {}
|
||||
: text(std::move(text_)), top(y), bottom(y), left(x), right(x) {}
|
||||
std::vector<PositionedGlyph> positionedGlyphs;
|
||||
std::u32string text;
|
||||
int32_t top;
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
#include <mbgl/util/work_task.hpp>
|
||||
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
WorkRequest::WorkRequest(Task task_) : task(task_) {
|
||||
WorkRequest::WorkRequest(Task task_) : task(std::move(task_)) {
|
||||
assert(task);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <mbgl/util/async_task.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
#include <mbgl/util/thread.hpp>
|
||||
#include <utility>
|
||||
|
||||
using namespace mbgl;
|
||||
|
||||
@@ -156,7 +157,7 @@ struct SpriteParams {
|
||||
|
||||
class SpriteThread : public SpriteStore::Observer {
|
||||
public:
|
||||
SpriteThread(FileSource* fileSource, SpriteTestCallback callback) : callback_(callback) {
|
||||
SpriteThread(FileSource* fileSource, SpriteTestCallback callback) : callback_(std::move(callback)) {
|
||||
util::ThreadContext::setFileSource(fileSource);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <mbgl/util/async_task.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
#include <mbgl/util/thread.hpp>
|
||||
#include <utility>
|
||||
|
||||
using namespace mbgl;
|
||||
|
||||
@@ -20,7 +21,7 @@ struct GlyphStoreParams {
|
||||
|
||||
class GlyphStoreThread : public GlyphStore::Observer {
|
||||
public:
|
||||
GlyphStoreThread(FileSource* fileSource, GlyphStoreTestCallback callback) : callback_(callback) {
|
||||
GlyphStoreThread(FileSource* fileSource, GlyphStoreTestCallback callback) : callback_(std::move(callback)) {
|
||||
util::ThreadContext::setFileSource(fileSource);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user