diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-12-01 17:45:21 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-12-03 15:38:36 +0100 |
commit | 478472e501a6aa579174f547277176c19104deb1 (patch) | |
tree | 12f9852c9c64725f8bbded04ee916c720fdf9dd8 | |
parent | d5fb535058d4d97567b08064e0203f45c2c8370f (diff) | |
download | qtlocation-mapboxgl-478472e501a6aa579174f547277176c19104deb1.tar.gz |
[core] add std::move to constructors
-rw-r--r-- | include/mbgl/util/run_loop.hpp | 2 | ||||
-rw-r--r-- | platform/default/headless_view.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/annotation/annotation_tile.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/map/tile_worker.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/map/vector_tile.cpp | 3 | ||||
-rw-r--r-- | src/mbgl/storage/request_base.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/style/layout_property.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/style/paint_property.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/text/glyph.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/util/work_request.cpp | 3 | ||||
-rw-r--r-- | test/sprite/sprite_store.cpp | 3 | ||||
-rw-r--r-- | test/style/glyph_store.cpp | 3 |
12 files changed, 23 insertions, 12 deletions
diff --git a/include/mbgl/util/run_loop.hpp b/include/mbgl/util/run_loop.hpp index 3cf92f56d0..fef00743f7 100644 --- a/include/mbgl/util/run_loop.hpp +++ b/include/mbgl/util/run_loop.hpp @@ -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)) { } diff --git a/platform/default/headless_view.cpp b/platform/default/headless_view.cpp index 3eaa4949b6..55a8c57773 100644 --- a/platform/default/headless_view.cpp +++ b/platform/default/headless_view.cpp @@ -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); } diff --git a/src/mbgl/annotation/annotation_tile.cpp b/src/mbgl/annotation/annotation_tile.cpp index 4a342c7e10..f3897ad3ea 100644 --- a/src/mbgl/annotation/annotation_tile.cpp +++ b/src/mbgl/annotation/annotation_tile.cpp @@ -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 { diff --git a/src/mbgl/map/tile_worker.cpp b/src/mbgl/map/tile_worker.cpp index 932bc0f689..177e8cdd71 100644 --- a/src/mbgl/map/tile_worker.cpp +++ b/src/mbgl/map/tile_worker.cpp @@ -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_), diff --git a/src/mbgl/map/vector_tile.cpp b/src/mbgl/map/vector_tile.cpp index f18c3f6821..00307f04a9 100644 --- a/src/mbgl/map/vector_tile.cpp +++ b/src/mbgl/map/vector_tile.cpp @@ -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 { diff --git a/src/mbgl/storage/request_base.hpp b/src/mbgl/storage/request_base.hpp index 0f3e257ad1..5e99041cd4 100644 --- a/src/mbgl/storage/request_base.hpp +++ b/src/mbgl/storage/request_base.hpp @@ -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; diff --git a/src/mbgl/style/layout_property.hpp b/src/mbgl/style/layout_property.hpp index 7feb931204..db2b2d3aba 100644 --- a/src/mbgl/style/layout_property.hpp +++ b/src/mbgl/style/layout_property.hpp @@ -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)) { diff --git a/src/mbgl/style/paint_property.hpp b/src/mbgl/style/paint_property.hpp index 88feb1307b..710ce34a4f 100644 --- a/src/mbgl/style/paint_property.hpp +++ b/src/mbgl/style/paint_property.hpp @@ -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) { diff --git a/src/mbgl/text/glyph.hpp b/src/mbgl/text/glyph.hpp index d1ba71c767..62949ee3fd 100644 --- a/src/mbgl/text/glyph.hpp +++ b/src/mbgl/text/glyph.hpp @@ -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; diff --git a/src/mbgl/util/work_request.cpp b/src/mbgl/util/work_request.cpp index 819585ae56..eb84df7bf2 100644 --- a/src/mbgl/util/work_request.cpp +++ b/src/mbgl/util/work_request.cpp @@ -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); } diff --git a/test/sprite/sprite_store.cpp b/test/sprite/sprite_store.cpp index fd8f3616f5..574af51b81 100644 --- a/test/sprite/sprite_store.cpp +++ b/test/sprite/sprite_store.cpp @@ -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); } diff --git a/test/style/glyph_store.cpp b/test/style/glyph_store.cpp index 8d7c2aeefa..4524716212 100644 --- a/test/style/glyph_store.cpp +++ b/test/style/glyph_store.cpp @@ -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); } |