[core] Fix performance-move-const-arg
This commit is contained in:
@@ -210,7 +210,8 @@ UniqueTexture Context::createUniqueTexture() {
|
||||
|
||||
TextureID id = pooledTextures.back();
|
||||
pooledTextures.pop_back();
|
||||
return UniqueTexture{ std::move(id), { this } };
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
return UniqueTexture{std::move(id), {this}};
|
||||
}
|
||||
|
||||
bool Context::supportsVertexArrays() const {
|
||||
@@ -224,6 +225,7 @@ VertexArray Context::createVertexArray() {
|
||||
if (supportsVertexArrays()) {
|
||||
VertexArrayID id = 0;
|
||||
MBGL_CHECK_ERROR(vertexArray->genVertexArrays(1, &id));
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
UniqueVertexArray vao(std::move(id), { this });
|
||||
return { UniqueVertexArrayState(new VertexArrayState(std::move(vao)), VertexArrayStateDeleter { true })};
|
||||
} else {
|
||||
@@ -236,6 +238,7 @@ VertexArray Context::createVertexArray() {
|
||||
UniqueFramebuffer Context::createFramebuffer() {
|
||||
FramebufferID id = 0;
|
||||
MBGL_CHECK_ERROR(glGenFramebuffers(1, &id));
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
return UniqueFramebuffer{ std::move(id), { this } };
|
||||
}
|
||||
|
||||
@@ -269,6 +272,7 @@ std::unique_ptr<gfx::RenderbufferResource>
|
||||
Context::createRenderbufferResource(const gfx::RenderbufferPixelType type, const Size size) {
|
||||
RenderbufferID id = 0;
|
||||
MBGL_CHECK_ERROR(glGenRenderbuffers(1, &id));
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
UniqueRenderbuffer renderbuffer{ std::move(id), { this } };
|
||||
|
||||
bindRenderbuffer = renderbuffer;
|
||||
|
||||
@@ -37,8 +37,7 @@ ActiveUniforms activeUniforms(ProgramID);
|
||||
template <class Value>
|
||||
class UniformState {
|
||||
public:
|
||||
UniformState(UniformLocation location_ = -1) : location(std::move(location_)) {
|
||||
}
|
||||
UniformState(UniformLocation location_ = -1) : location(location_) {}
|
||||
|
||||
void operator=(const Value& value) {
|
||||
if (location >= 0 && (!current || *current != value)) {
|
||||
|
||||
@@ -20,6 +20,7 @@ std::unique_ptr<gfx::VertexBufferResource> UploadPass::createVertexBufferResourc
|
||||
const void* data, std::size_t size, const gfx::BufferUsageType usage) {
|
||||
BufferID id = 0;
|
||||
MBGL_CHECK_ERROR(glGenBuffers(1, &id));
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
UniqueBuffer result{ std::move(id), { commandEncoder.context } };
|
||||
commandEncoder.context.vertexBuffer = result;
|
||||
MBGL_CHECK_ERROR(
|
||||
@@ -38,6 +39,7 @@ std::unique_ptr<gfx::IndexBufferResource> UploadPass::createIndexBufferResource(
|
||||
const void* data, std::size_t size, const gfx::BufferUsageType usage) {
|
||||
BufferID id = 0;
|
||||
MBGL_CHECK_ERROR(glGenBuffers(1, &id));
|
||||
// NOLINTNEXTLINE(performance-move-const-arg)
|
||||
UniqueBuffer result{ std::move(id), { commandEncoder.context } };
|
||||
commandEncoder.context.bindVertexArray = 0;
|
||||
commandEncoder.context.globalVertexArrayState.indexBuffer = result;
|
||||
|
||||
@@ -17,7 +17,7 @@ std::unique_ptr<style::Layer> BackgroundLayerFactory::createLayer(const std::str
|
||||
|
||||
std::unique_ptr<RenderLayer> BackgroundLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderBackgroundLayer>(staticImmutableCast<style::BackgroundLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderBackgroundLayer>(staticImmutableCast<style::BackgroundLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -30,7 +30,7 @@ std::unique_ptr<Bucket> CircleLayerFactory::createBucket(const BucketParameters&
|
||||
|
||||
std::unique_ptr<RenderLayer> CircleLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderCircleLayer>(staticImmutableCast<style::CircleLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderCircleLayer>(staticImmutableCast<style::CircleLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -16,7 +16,7 @@ std::unique_ptr<style::Layer> CustomLayerFactory::createLayer(const std::string&
|
||||
}
|
||||
|
||||
std::unique_ptr<RenderLayer> CustomLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
return std::make_unique<RenderCustomLayer>(staticImmutableCast<style::CustomLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderCustomLayer>(staticImmutableCast<style::CustomLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -34,7 +34,7 @@ std::unique_ptr<Layout> FillExtrusionLayerFactory::createLayout(const LayoutPara
|
||||
|
||||
std::unique_ptr<RenderLayer> FillExtrusionLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderFillExtrusionLayer>(staticImmutableCast<style::FillExtrusionLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderFillExtrusionLayer>(staticImmutableCast<style::FillExtrusionLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -35,7 +35,7 @@ FillLayerFactory::createLayout(const LayoutParameters& parameters,
|
||||
|
||||
std::unique_ptr<RenderLayer> FillLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderFillLayer>(staticImmutableCast<style::FillLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderFillLayer>(staticImmutableCast<style::FillLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -30,7 +30,7 @@ std::unique_ptr<Bucket> HeatmapLayerFactory::createBucket(const BucketParameters
|
||||
|
||||
std::unique_ptr<RenderLayer> HeatmapLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderHeatmapLayer>(staticImmutableCast<style::HeatmapLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderHeatmapLayer>(staticImmutableCast<style::HeatmapLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -22,7 +22,7 @@ std::unique_ptr<style::Layer> HillshadeLayerFactory::createLayer(const std::stri
|
||||
|
||||
std::unique_ptr<RenderLayer> HillshadeLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderHillshadeLayer>(staticImmutableCast<style::HillshadeLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderHillshadeLayer>(staticImmutableCast<style::HillshadeLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -34,7 +34,7 @@ std::unique_ptr<Layout> LineLayerFactory::createLayout(const LayoutParameters& p
|
||||
|
||||
std::unique_ptr<RenderLayer> LineLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderLineLayer>(staticImmutableCast<style::LineLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderLineLayer>(staticImmutableCast<style::LineLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -22,7 +22,7 @@ std::unique_ptr<style::Layer> RasterLayerFactory::createLayer(const std::string&
|
||||
|
||||
std::unique_ptr<RenderLayer> RasterLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderRasterLayer>(staticImmutableCast<style::RasterLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderRasterLayer>(staticImmutableCast<style::RasterLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -36,7 +36,7 @@ std::unique_ptr<Layout> SymbolLayerFactory::createLayout(const LayoutParameters&
|
||||
|
||||
std::unique_ptr<RenderLayer> SymbolLayerFactory::createRenderLayer(Immutable<style::Layer::Impl> impl) noexcept {
|
||||
assert(impl->getTypeInfo() == getTypeInfo());
|
||||
return std::make_unique<RenderSymbolLayer>(staticImmutableCast<style::SymbolLayer::Impl>(std::move(impl)));
|
||||
return std::make_unique<RenderSymbolLayer>(staticImmutableCast<style::SymbolLayer::Impl>(impl));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -29,11 +29,9 @@ namespace mbgl {
|
||||
: point(point_), angle(angle_), tileDistance(std::move(tileDistance_))
|
||||
{}
|
||||
PlacedGlyph(PlacedGlyph&& other) noexcept
|
||||
: point(std::move(other.point)), angle(other.angle), tileDistance(std::move(other.tileDistance))
|
||||
{}
|
||||
: point(other.point), angle(other.angle), tileDistance(std::move(other.tileDistance)) {}
|
||||
PlacedGlyph(const PlacedGlyph& other)
|
||||
: point(std::move(other.point)), angle(other.angle), tileDistance(std::move(other.tileDistance))
|
||||
{}
|
||||
: point(other.point), angle(other.angle), tileDistance(other.tileDistance) {}
|
||||
Point<float> point;
|
||||
float angle;
|
||||
optional<TileDistance> tileDistance;
|
||||
|
||||
@@ -356,7 +356,7 @@ void Transform::setLatLngBounds(LatLngBounds bounds) {
|
||||
if (!bounds.valid()) {
|
||||
throw std::runtime_error("failed to set bounds: bounds are invalid");
|
||||
}
|
||||
state.setLatLngBounds(std::move(bounds));
|
||||
state.setLatLngBounds(bounds);
|
||||
}
|
||||
|
||||
void Transform::setMinZoom(const double minZoom) {
|
||||
|
||||
@@ -172,21 +172,20 @@ public:
|
||||
drawScopeIt = segment.drawScopes.emplace(layerID, context.createDrawScope()).first;
|
||||
}
|
||||
|
||||
program->draw(
|
||||
context,
|
||||
renderPass,
|
||||
std::move(drawMode),
|
||||
std::move(depthMode),
|
||||
std::move(stencilMode),
|
||||
std::move(colorMode),
|
||||
std::move(cullFaceMode),
|
||||
uniformValues,
|
||||
drawScopeIt->second,
|
||||
allAttributeBindings.offset(segment.vertexOffset),
|
||||
textureBindings,
|
||||
indexBuffer,
|
||||
segment.indexOffset,
|
||||
segment.indexLength);
|
||||
program->draw(context,
|
||||
renderPass,
|
||||
drawMode,
|
||||
depthMode,
|
||||
stencilMode,
|
||||
colorMode,
|
||||
cullFaceMode,
|
||||
uniformValues,
|
||||
drawScopeIt->second,
|
||||
allAttributeBindings.offset(segment.vertexOffset),
|
||||
textureBindings,
|
||||
indexBuffer,
|
||||
segment.indexOffset,
|
||||
segment.indexLength);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,8 +16,7 @@ Programs::Programs(gfx::Context& context_, const ProgramParameters& programParam
|
||||
: debug(context_, programParameters_),
|
||||
clippingMask(context_, programParameters_),
|
||||
context(context_),
|
||||
programParameters(std::move(programParameters_)) {
|
||||
}
|
||||
programParameters(programParameters_) {}
|
||||
|
||||
Programs::~Programs() = default;
|
||||
|
||||
|
||||
@@ -14,10 +14,7 @@ LineBucket::LineBucket(const style::LineLayoutProperties::PossiblyEvaluated layo
|
||||
const std::map<std::string, Immutable<style::LayerProperties>>& layerPaintProperties,
|
||||
const float zoom_,
|
||||
const uint32_t overscaling_)
|
||||
: layout(std::move(layout_)),
|
||||
zoom(zoom_),
|
||||
overscaling(overscaling_) {
|
||||
|
||||
: layout(layout_), zoom(zoom_), overscaling(overscaling_) {
|
||||
for (const auto& pair : layerPaintProperties) {
|
||||
paintPropertyBinders.emplace(
|
||||
std::piecewise_construct,
|
||||
|
||||
@@ -26,7 +26,7 @@ SymbolBucket::SymbolBucket(Immutable<style::SymbolLayoutProperties::PossiblyEval
|
||||
bool allowVerticalPlacement_,
|
||||
std::vector<style::TextWritingModeType> placementModes_)
|
||||
: layout(std::move(layout_)),
|
||||
bucketLeaderID(std::move(bucketName_)),
|
||||
bucketLeaderID(bucketName_),
|
||||
iconsNeedLinear(iconsNeedLinear_ || iconSize.isDataDriven() || !iconSize.isZoomConstant()),
|
||||
sortFeaturesByY(sortFeaturesByY_),
|
||||
staticUploaded(false),
|
||||
@@ -35,14 +35,13 @@ SymbolBucket::SymbolBucket(Immutable<style::SymbolLayoutProperties::PossiblyEval
|
||||
sortUploaded(false),
|
||||
justReloaded(false),
|
||||
hasVariablePlacement(false),
|
||||
symbolInstances(std::move(symbolInstances_)),
|
||||
symbolInstances(symbolInstances_),
|
||||
textSizeBinder(SymbolSizeBinder::create(zoom, textSize, TextSize::defaultValue())),
|
||||
iconSizeBinder(SymbolSizeBinder::create(zoom, iconSize, IconSize::defaultValue())),
|
||||
tilePixelRatio(tilePixelRatio_),
|
||||
bucketInstanceId(++maxBucketInstanceId),
|
||||
allowVerticalPlacement(allowVerticalPlacement_),
|
||||
placementModes(std::move(placementModes_)) {
|
||||
|
||||
for (const auto& pair : paintProperties_) {
|
||||
const auto& evaluated = getEvaluated<SymbolLayerProperties>(pair.second);
|
||||
paintProperties.emplace(
|
||||
|
||||
@@ -124,7 +124,7 @@ void ImageManager::getImages(ImageRequestor& requestor, ImageRequestPair&& pair)
|
||||
requestors.emplace(&requestor, std::move(pair));
|
||||
}
|
||||
} else {
|
||||
checkMissingAndNotify(requestor, std::move(pair));
|
||||
checkMissingAndNotify(requestor, pair);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ struct RenderableSegment {
|
||||
const LayerRenderData& renderData_,
|
||||
const SymbolBucket::PaintProperties& bucketPaintProperties_,
|
||||
float sortKey_,
|
||||
const SymbolType type_) :
|
||||
segment(std::move(segment_)),
|
||||
tile(tile_),
|
||||
renderData(renderData_),
|
||||
bucketPaintProperties(bucketPaintProperties_),
|
||||
sortKey(sortKey_),
|
||||
type(type_) {}
|
||||
const SymbolType type_)
|
||||
: segment(segment_),
|
||||
tile(tile_),
|
||||
renderData(renderData_),
|
||||
bucketPaintProperties(bucketPaintProperties_),
|
||||
sortKey(sortKey_),
|
||||
type(type_) {}
|
||||
|
||||
SegmentWrapper segment;
|
||||
const RenderTile& tile;
|
||||
|
||||
@@ -20,13 +20,8 @@ public:
|
||||
zoomHistory(),
|
||||
defaultFadeDuration(0) {}
|
||||
|
||||
PropertyEvaluationParameters(ZoomHistory zoomHistory_,
|
||||
TimePoint now_,
|
||||
Duration defaultFadeDuration_)
|
||||
: z(zoomHistory_.lastZoom),
|
||||
now(std::move(now_)),
|
||||
zoomHistory(std::move(zoomHistory_)),
|
||||
defaultFadeDuration(std::move(defaultFadeDuration_)) {}
|
||||
PropertyEvaluationParameters(ZoomHistory zoomHistory_, TimePoint now_, Duration defaultFadeDuration_)
|
||||
: z(zoomHistory_.lastZoom), now(now_), zoomHistory(zoomHistory_), defaultFadeDuration(defaultFadeDuration_) {}
|
||||
|
||||
CrossfadeParameters getCrossfadeParameters() const {
|
||||
const float fraction = z - std::floor(z);
|
||||
|
||||
@@ -16,9 +16,7 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
RenderTile::RenderTile(UnwrappedTileID id_, Tile& tile_)
|
||||
: id(std::move(id_)), tile(tile_) {
|
||||
}
|
||||
RenderTile::RenderTile(UnwrappedTileID id_, Tile& tile_) : id(id_), tile(tile_) {}
|
||||
|
||||
RenderTile::~RenderTile() = default;
|
||||
|
||||
|
||||
@@ -8,13 +8,8 @@
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
Renderer::Renderer(gfx::RendererBackend& backend,
|
||||
float pixelRatio_,
|
||||
const optional<std::string> localFontFamily_)
|
||||
: impl(std::make_unique<Impl>(backend,
|
||||
pixelRatio_,
|
||||
std::move(localFontFamily_))) {
|
||||
}
|
||||
Renderer::Renderer(gfx::RendererBackend& backend, float pixelRatio_, const optional<std::string> localFontFamily_)
|
||||
: impl(std::make_unique<Impl>(backend, pixelRatio_, localFontFamily_)) {}
|
||||
|
||||
Renderer::~Renderer() {
|
||||
gfx::BackendScope guard { impl->backend };
|
||||
|
||||
@@ -6,8 +6,8 @@ ResourceTransform::ResourceTransform(ActorRef<ResourceTransform>, TransformCallb
|
||||
: transformCallback(std::move(callback)) {
|
||||
}
|
||||
|
||||
void ResourceTransform::transform(Resource::Kind kind, const std::string&& url, FinishedCallback&& finished) {
|
||||
finished(transformCallback(kind, std::move(url)));
|
||||
void ResourceTransform::transform(Resource::Kind kind, const std::string& url, FinishedCallback&& finished) {
|
||||
finished(transformCallback(kind, url));
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -128,7 +128,7 @@ static optional<std::unique_ptr<Source>> convertGeoJSONSource(const std::string&
|
||||
if (!geoJSON) {
|
||||
return nullopt;
|
||||
}
|
||||
result->setGeoJSON(std::move(*geoJSON));
|
||||
result->setGeoJSON(*geoJSON);
|
||||
} else if (toString(*dataValue)) {
|
||||
result->setURL(*toString(*dataValue));
|
||||
} else {
|
||||
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
for (std::size_t i = 0; i < sizeof...(Params); ++i) {
|
||||
const EvaluationResult evaluatedArg = args.at(i)->evaluate(evaluationParameters);
|
||||
if (!evaluatedArg) return evaluatedArg.error();
|
||||
evaluated[i] = std::move(*evaluatedArg);
|
||||
evaluated[i] = *evaluatedArg;
|
||||
}
|
||||
const R value = evaluate(*fromExpressionValue<std::decay_t<Params>>(evaluated[I])...);
|
||||
if (!value) return value.error();
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
for (std::size_t i = 0; i < sizeof...(Params); ++i) {
|
||||
const EvaluationResult evaluatedArg = args.at(i)->evaluate(evaluationParameters);
|
||||
if (!evaluatedArg) return evaluatedArg.error();
|
||||
evaluated[i] = std::move(*evaluatedArg);
|
||||
evaluated[i] = *evaluatedArg;
|
||||
}
|
||||
const R value = evaluate(evaluationParameters, *fromExpressionValue<std::decay_t<Params>>(evaluated[I])...);
|
||||
if (!value) return value.error();
|
||||
|
||||
@@ -18,7 +18,7 @@ BackgroundLayerProperties::BackgroundLayerProperties(
|
||||
CrossfadeParameters crossfade_,
|
||||
BackgroundPaintProperties::PossiblyEvaluated evaluated_)
|
||||
: LayerProperties(std::move(impl_)),
|
||||
crossfade(std::move(crossfade_)),
|
||||
crossfade(crossfade_),
|
||||
evaluated(std::move(evaluated_)) {}
|
||||
|
||||
BackgroundLayerProperties::~BackgroundLayerProperties() = default;
|
||||
|
||||
@@ -18,7 +18,7 @@ FillExtrusionLayerProperties::FillExtrusionLayerProperties(
|
||||
CrossfadeParameters crossfade_,
|
||||
FillExtrusionPaintProperties::PossiblyEvaluated evaluated_)
|
||||
: LayerProperties(std::move(impl_)),
|
||||
crossfade(std::move(crossfade_)),
|
||||
crossfade(crossfade_),
|
||||
evaluated(std::move(evaluated_)) {}
|
||||
|
||||
FillExtrusionLayerProperties::~FillExtrusionLayerProperties() = default;
|
||||
|
||||
@@ -18,7 +18,7 @@ FillLayerProperties::FillLayerProperties(
|
||||
CrossfadeParameters crossfade_,
|
||||
FillPaintProperties::PossiblyEvaluated evaluated_)
|
||||
: LayerProperties(std::move(impl_)),
|
||||
crossfade(std::move(crossfade_)),
|
||||
crossfade(crossfade_),
|
||||
evaluated(std::move(evaluated_)) {}
|
||||
|
||||
FillLayerProperties::~FillLayerProperties() = default;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace style {
|
||||
<%- camelize(type) %>PaintProperties::PossiblyEvaluated evaluated_)
|
||||
: LayerProperties(std::move(impl_)),
|
||||
<% if (type === 'background' || type === 'fill' || type === 'line' || type === 'fill-extrusion') { -%>
|
||||
crossfade(std::move(crossfade_)),
|
||||
crossfade(crossfade_),
|
||||
<% } -%>
|
||||
evaluated(std::move(evaluated_)) {}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ LineLayerProperties::LineLayerProperties(
|
||||
CrossfadeParameters crossfade_,
|
||||
LinePaintProperties::PossiblyEvaluated evaluated_)
|
||||
: LayerProperties(std::move(impl_)),
|
||||
crossfade(std::move(crossfade_)),
|
||||
crossfade(crossfade_),
|
||||
evaluated(std::move(evaluated_)) {}
|
||||
|
||||
LineLayerProperties::~LineLayerProperties() = default;
|
||||
|
||||
@@ -138,7 +138,7 @@ void Parser::parseLight(const JSValue& value) {
|
||||
return;
|
||||
}
|
||||
|
||||
light = std::move(*converted);
|
||||
light = *converted;
|
||||
}
|
||||
|
||||
void Parser::parseSources(const JSValue& value) {
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace mbgl {
|
||||
namespace style {
|
||||
|
||||
GeoJSONSource::GeoJSONSource(const std::string& id, optional<GeoJSONOptions> options)
|
||||
: Source(makeMutable<Impl>(std::move(id), options)) {
|
||||
}
|
||||
: Source(makeMutable<Impl>(id, options)) {}
|
||||
|
||||
GeoJSONSource::~GeoJSONSource() = default;
|
||||
|
||||
@@ -22,7 +21,7 @@ const GeoJSONSource::Impl& GeoJSONSource::impl() const {
|
||||
}
|
||||
|
||||
void GeoJSONSource::setURL(const std::string& url_) {
|
||||
url = std::move(url_);
|
||||
url = url_;
|
||||
|
||||
// Signal that the source description needs a reload
|
||||
if (loaded || req) {
|
||||
|
||||
@@ -30,7 +30,7 @@ std::array<LatLng, 4> ImageSource::getCoordinates() const {
|
||||
}
|
||||
|
||||
void ImageSource::setURL(const std::string& url_) {
|
||||
url = std::move(url_);
|
||||
url = url_;
|
||||
// Signal that the source description needs a reload
|
||||
if (loaded || req) {
|
||||
loaded = false;
|
||||
|
||||
@@ -5,15 +5,10 @@ namespace mbgl {
|
||||
namespace style {
|
||||
|
||||
ImageSource::Impl::Impl(std::string id_, std::array<LatLng, 4> coords_)
|
||||
: Source::Impl(SourceType::Image, std::move(id_)),
|
||||
coords(std::move(coords_)) {
|
||||
}
|
||||
: Source::Impl(SourceType::Image, std::move(id_)), coords(coords_) {}
|
||||
|
||||
ImageSource::Impl::Impl(const Impl& other, std::array<LatLng, 4> coords_)
|
||||
: Source::Impl(other),
|
||||
coords(std::move(coords_)),
|
||||
image(other.image) {
|
||||
}
|
||||
: Source::Impl(other), coords(coords_), image(other.image) {}
|
||||
|
||||
ImageSource::Impl::Impl(const Impl& rhs, PremultipliedImage&& image_)
|
||||
: Source::Impl(rhs),
|
||||
|
||||
@@ -47,8 +47,8 @@ private:
|
||||
|
||||
class CollisionBox {
|
||||
public:
|
||||
CollisionBox(Point<float> _anchor, float _x1, float _y1, float _x2, float _y2, float _signedDistanceFromAnchor = 0) :
|
||||
anchor(std::move(_anchor)), x1(_x1), y1(_y1), x2(_x2), y2(_y2), signedDistanceFromAnchor(_signedDistanceFromAnchor) {}
|
||||
CollisionBox(Point<float> _anchor, float _x1, float _y1, float _x2, float _y2, float _signedDistanceFromAnchor = 0)
|
||||
: anchor(_anchor), x1(_x1), y1(_y1), x2(_x2), y2(_y2), signedDistanceFromAnchor(_signedDistanceFromAnchor) {}
|
||||
|
||||
// the box is centered around the anchor point
|
||||
Point<float> anchor;
|
||||
|
||||
@@ -63,12 +63,8 @@ struct RetainedQueryData {
|
||||
OverscaledTileID tileID;
|
||||
mutable FeatureSortOrder featureSortOrder;
|
||||
|
||||
RetainedQueryData(uint32_t bucketInstanceId_,
|
||||
std::shared_ptr<FeatureIndex> featureIndex_,
|
||||
OverscaledTileID tileID_)
|
||||
: bucketInstanceId(bucketInstanceId_)
|
||||
, featureIndex(std::move(featureIndex_))
|
||||
, tileID(std::move(tileID_)) {}
|
||||
RetainedQueryData(uint32_t bucketInstanceId_, std::shared_ptr<FeatureIndex> featureIndex_, OverscaledTileID tileID_)
|
||||
: bucketInstanceId(bucketInstanceId_), featureIndex(std::move(featureIndex_)), tileID(tileID_) {}
|
||||
};
|
||||
|
||||
class CollisionGroups {
|
||||
|
||||
@@ -22,14 +22,14 @@ public:
|
||||
WritingModeType writingMode_,
|
||||
Point<float> glyphOffset_,
|
||||
size_t sectionIndex_ = 0)
|
||||
: tl(std::move(tl_)),
|
||||
tr(std::move(tr_)),
|
||||
bl(std::move(bl_)),
|
||||
br(std::move(br_)),
|
||||
tex(std::move(tex_)),
|
||||
writingMode(writingMode_),
|
||||
glyphOffset(glyphOffset_),
|
||||
sectionIndex(sectionIndex_){}
|
||||
: tl(tl_),
|
||||
tr(tr_),
|
||||
bl(bl_),
|
||||
br(br_),
|
||||
tex(tex_),
|
||||
writingMode(writingMode_),
|
||||
glyphOffset(glyphOffset_),
|
||||
sectionIndex(sectionIndex_) {}
|
||||
|
||||
Point<float> tl;
|
||||
Point<float> tr;
|
||||
|
||||
@@ -27,18 +27,8 @@ class BiDi;
|
||||
|
||||
class PositionedIcon {
|
||||
private:
|
||||
PositionedIcon(ImagePosition image_,
|
||||
float top_,
|
||||
float bottom_,
|
||||
float left_,
|
||||
float right_,
|
||||
float angle_)
|
||||
: _image(std::move(image_)),
|
||||
_top(top_),
|
||||
_bottom(bottom_),
|
||||
_left(left_),
|
||||
_right(right_),
|
||||
_angle(angle_) {}
|
||||
PositionedIcon(ImagePosition image_, float top_, float bottom_, float left_, float right_, float angle_)
|
||||
: _image(image_), _top(top_), _bottom(bottom_), _left(left_), _right(right_), _angle(angle_) {}
|
||||
|
||||
ImagePosition _image;
|
||||
float _top;
|
||||
|
||||
@@ -24,8 +24,7 @@ public:
|
||||
|
||||
template <class... Args>
|
||||
GeometryCoordinates(Args&&... args) : std::vector<GeometryCoordinate>(std::forward<Args>(args)...) {}
|
||||
GeometryCoordinates(std::initializer_list<GeometryCoordinate> args)
|
||||
: std::vector<GeometryCoordinate>(std::move(args)) {}
|
||||
GeometryCoordinates(std::initializer_list<GeometryCoordinate> args) : std::vector<GeometryCoordinate>(args) {}
|
||||
};
|
||||
|
||||
class GeometryCollection : public std::vector<GeometryCoordinates> {
|
||||
@@ -33,8 +32,7 @@ public:
|
||||
using coordinate_type = int16_t;
|
||||
template <class... Args>
|
||||
GeometryCollection(Args&&... args) : std::vector<GeometryCoordinates>(std::forward<Args>(args)...) {}
|
||||
GeometryCollection(std::initializer_list<GeometryCoordinates> args)
|
||||
: std::vector<GeometryCoordinates>(std::move(args)) {}
|
||||
GeometryCollection(std::initializer_list<GeometryCoordinates> args) : std::vector<GeometryCoordinates>(args) {}
|
||||
GeometryCollection(GeometryCollection&&) = default;
|
||||
GeometryCollection& operator=(GeometryCollection&&) = default;
|
||||
|
||||
|
||||
@@ -37,13 +37,12 @@ GeometryTileWorker::GeometryTileWorker(ActorRef<GeometryTileWorker> self_,
|
||||
const bool showCollisionBoxes_)
|
||||
: self(std::move(self_)),
|
||||
parent(std::move(parent_)),
|
||||
id(std::move(id_)),
|
||||
id(id_),
|
||||
sourceID(std::move(sourceID_)),
|
||||
obsolete(obsolete_),
|
||||
mode(mode_),
|
||||
pixelRatio(pixelRatio_),
|
||||
showCollisionBoxes(showCollisionBoxes_) {
|
||||
}
|
||||
showCollisionBoxes(showCollisionBoxes_) {}
|
||||
|
||||
GeometryTileWorker::~GeometryTileWorker() = default;
|
||||
|
||||
|
||||
@@ -8,8 +8,7 @@ namespace mbgl {
|
||||
|
||||
static TileObserver nullObserver;
|
||||
|
||||
Tile::Tile(Kind kind_, OverscaledTileID id_) : kind(kind_), id(std::move(id_)), observer(&nullObserver) {
|
||||
}
|
||||
Tile::Tile(Kind kind_, OverscaledTileID id_) : kind(kind_), id(id_), observer(&nullObserver) {}
|
||||
|
||||
Tile::~Tile() = default;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ FeatureType VectorTileFeature::getType() const {
|
||||
|
||||
optional<Value> VectorTileFeature::getValue(const std::string& key) const {
|
||||
const optional<Value> value(feature.getValue(key));
|
||||
return value->is<NullValue>() ? nullopt : std::move(value);
|
||||
return value->is<NullValue>() ? nullopt : value;
|
||||
}
|
||||
|
||||
const PropertyMap& VectorTileFeature::getProperties() const {
|
||||
|
||||
Reference in New Issue
Block a user