[core] use std::move() to prevent copies
This commit is contained in:
@@ -31,7 +31,7 @@ public:
|
||||
Resource(Kind kind_, const std::string& url_, optional<TileData> tileData_ = {})
|
||||
: kind(kind_),
|
||||
url(url_),
|
||||
tileData(tileData_) {
|
||||
tileData(std::move(tileData_)) {
|
||||
}
|
||||
|
||||
static Resource style(const std::string& url);
|
||||
|
||||
@@ -190,7 +190,7 @@ std::unique_ptr<FileRequest> OnlineFileSource::request(const Resource& resource,
|
||||
OnlineFileRequestImpl::OnlineFileRequestImpl(FileRequest* key_, const Resource& resource_, Callback callback_, OnlineFileSource::Impl& impl)
|
||||
: key(key_),
|
||||
resource(resource_),
|
||||
callback(callback_) {
|
||||
callback(std::move(callback_)) {
|
||||
// Force an immediate first request if we don't have an expiration time.
|
||||
schedule(impl, !resource.priorExpires);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ AnnotationTileFeature::AnnotationTileFeature(FeatureType type_, GeometryCollecti
|
||||
std::unordered_map<std::string, std::string> properties_)
|
||||
: type(type_),
|
||||
properties(std::move(properties_)),
|
||||
geometries(geometries_) {}
|
||||
geometries(std::move(geometries_)) {}
|
||||
|
||||
optional<Value> AnnotationTileFeature::getValue(const std::string& key) const {
|
||||
auto it = properties.find(key);
|
||||
|
||||
@@ -11,8 +11,8 @@ using namespace mbgl;
|
||||
|
||||
DebugBucket::DebugBucket(const TileID id, const TileData::State state_, optional<SystemTimePoint> modified_, optional<SystemTimePoint> expires_, MapDebugOptions debugMode_)
|
||||
: state(state_),
|
||||
modified(modified_),
|
||||
expires(expires_),
|
||||
modified(std::move(modified_)),
|
||||
expires(std::move(expires_)),
|
||||
debugMode(debugMode_) {
|
||||
double baseline = 200;
|
||||
if (debugMode & MapDebugOptions::ParseStatus) {
|
||||
|
||||
Reference in New Issue
Block a user