[core] Fix performance-no-automatic-move (bonus)
As reported by clang-tidy-10. We don't run clang-tidy-10 yet. We should probably consider moving the bots at some point so errors like this won't return.
This commit is contained in:
@@ -90,8 +90,8 @@ protected:
|
||||
template <typename TaskFn, typename ReplyFn>
|
||||
void scheduleAndReplyValue(const TaskFn& task,
|
||||
const ReplyFn& reply,
|
||||
const mapbox::base::WeakPtr<Scheduler>& replyScheduler) {
|
||||
auto scheduled = [replyScheduler, task, reply] {
|
||||
mapbox::base::WeakPtr<Scheduler> replyScheduler) {
|
||||
auto scheduled = [replyScheduler = std::move(replyScheduler), task, reply] {
|
||||
auto lock = replyScheduler.lock();
|
||||
if (!replyScheduler) return;
|
||||
auto scheduledReply = [reply, result = task()] { reply(result); };
|
||||
|
||||
@@ -49,8 +49,8 @@ private:
|
||||
|
||||
class Var : public Expression {
|
||||
public:
|
||||
Var(std::string name_, const std::shared_ptr<Expression>& value_)
|
||||
: Expression(Kind::Var, value_->getType()), name(std::move(name_)), value(value_) {}
|
||||
Var(std::string name_, std::shared_ptr<Expression> value_)
|
||||
: Expression(Kind::Var, value_->getType()), name(std::move(name_)), value(std::move(value_)) {}
|
||||
|
||||
static ParseResult parse(const mbgl::style::conversion::Convertible&, ParsingContext&);
|
||||
|
||||
|
||||
@@ -14,7 +14,8 @@ class Literal : public Expression {
|
||||
public:
|
||||
Literal(const Value& value_) : Expression(Kind::Literal, typeOf(value_)), value(value_) {}
|
||||
|
||||
Literal(const type::Array& type_, std::vector<Value> value_) : Expression(Kind::Literal, type_), value(value_) {}
|
||||
Literal(const type::Array& type_, std::vector<Value> value_)
|
||||
: Expression(Kind::Literal, type_), value(std::move(value_)) {}
|
||||
|
||||
EvaluationResult evaluate(const EvaluationContext&) const override {
|
||||
return value;
|
||||
|
||||
@@ -371,7 +371,7 @@ void SymbolLayout::prepareSymbols(const GlyphMap& glyphMap,
|
||||
WritingModeType writingMode,
|
||||
SymbolAnchorType textAnchor,
|
||||
TextJustifyType textJustify) {
|
||||
const Shaping result = getShaping(
|
||||
Shaping result = getShaping(
|
||||
/* string */ formattedText,
|
||||
/* maxWidth: ems */
|
||||
isPointPlacement ? layout->evaluate<TextMaxWidth>(zoom, feature, canonicalID) * util::ONE_EM : 0.0f,
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace expression {
|
||||
|
||||
EvaluationResult Any::evaluate(const EvaluationContext& params) const {
|
||||
for (const auto& input : inputs) {
|
||||
const EvaluationResult result = input->evaluate(params);
|
||||
EvaluationResult result = input->evaluate(params);
|
||||
if (!result) return result;
|
||||
if (result->get<bool>()) return EvaluationResult(true);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ std::vector<optional<Value>> Any::possibleOutputs() const {
|
||||
|
||||
EvaluationResult All::evaluate(const EvaluationContext& params) const {
|
||||
for (const auto& input : inputs) {
|
||||
const EvaluationResult result = input->evaluate(params);
|
||||
EvaluationResult result = input->evaluate(params);
|
||||
if (!result) return result;
|
||||
if (!result->get<bool>()) return EvaluationResult(false);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ Length::Length(std::unique_ptr<Expression> input_)
|
||||
}
|
||||
|
||||
EvaluationResult Length::evaluate(const EvaluationContext& params) const {
|
||||
const EvaluationResult value = input->evaluate(params);
|
||||
EvaluationResult value = input->evaluate(params);
|
||||
if (!value) return value;
|
||||
return value->match(
|
||||
[] (const std::string& s) {
|
||||
|
||||
Reference in New Issue
Block a user