summaryrefslogtreecommitdiff
path: root/include/mbgl/style
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style')
-rw-r--r--include/mbgl/style/expression/collator.hpp2
-rw-r--r--include/mbgl/style/expression/comparison.hpp4
-rw-r--r--include/mbgl/style/expression/compound_expression.hpp2
-rw-r--r--include/mbgl/style/expression/dsl.hpp8
-rw-r--r--include/mbgl/style/expression/parsing_context.hpp11
-rw-r--r--include/mbgl/style/image.hpp2
-rw-r--r--include/mbgl/style/sources/custom_geometry_source.hpp2
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp2
8 files changed, 16 insertions, 17 deletions
diff --git a/include/mbgl/style/expression/collator.hpp b/include/mbgl/style/expression/collator.hpp
index 51ba426fad..95a072618a 100644
--- a/include/mbgl/style/expression/collator.hpp
+++ b/include/mbgl/style/expression/collator.hpp
@@ -11,7 +11,7 @@ namespace expression {
class Collator {
public:
- Collator(bool caseSensitive, bool diacriticSensitive, optional<std::string> locale = {});
+ Collator(bool caseSensitive, bool diacriticSensitive, const optional<std::string>& locale = {});
bool operator==(const Collator& other) const;
diff --git a/include/mbgl/style/expression/comparison.hpp b/include/mbgl/style/expression/comparison.hpp
index cf64f5cd34..df1fbcab9e 100644
--- a/include/mbgl/style/expression/comparison.hpp
+++ b/include/mbgl/style/expression/comparison.hpp
@@ -15,7 +15,7 @@ ParseResult parseComparison(const mbgl::style::conversion::Convertible&, Parsing
class BasicComparison : public Expression {
public:
- using CompareFunctionType = bool (*) (Value, Value);
+ using CompareFunctionType = bool (*)(const Value&, const Value&);
BasicComparison(
std::string op,
@@ -38,7 +38,7 @@ private:
class CollatorComparison : public Expression {
public:
- using CompareFunctionType = bool (*) (std::string, std::string, Collator);
+ using CompareFunctionType = bool (*)(const std::string&, const std::string&, const Collator&);
CollatorComparison(
std::string op,
diff --git a/include/mbgl/style/expression/compound_expression.hpp b/include/mbgl/style/expression/compound_expression.hpp
index 57a96d08a0..c6c66c3fc6 100644
--- a/include/mbgl/style/expression/compound_expression.hpp
+++ b/include/mbgl/style/expression/compound_expression.hpp
@@ -46,7 +46,7 @@ protected:
std::vector<std::unique_ptr<Expression>> args;
};
-ParseResult parseCompoundExpression(const std::string name,
+ParseResult parseCompoundExpression(const std::string& name,
const mbgl::style::conversion::Convertible& value,
ParsingContext& ctx);
diff --git a/include/mbgl/style/expression/dsl.hpp b/include/mbgl/style/expression/dsl.hpp
index 347861abc9..6bb1d22d64 100644
--- a/include/mbgl/style/expression/dsl.hpp
+++ b/include/mbgl/style/expression/dsl.hpp
@@ -29,13 +29,13 @@ std::unique_ptr<Expression> createExpression(const mbgl::style::conversion::Conv
std::unique_ptr<Expression> error(std::string);
std::unique_ptr<Expression> literal(const char* value);
-std::unique_ptr<Expression> literal(Value value);
+std::unique_ptr<Expression> literal(const Value& value);
std::unique_ptr<Expression> literal(std::initializer_list<double> value);
std::unique_ptr<Expression> literal(std::initializer_list<const char*> value);
-std::unique_ptr<Expression>
-assertion(type::Type, std::unique_ptr<Expression>,
- std::unique_ptr<Expression> def = nullptr);
+std::unique_ptr<Expression> assertion(const type::Type&,
+ std::unique_ptr<Expression>,
+ std::unique_ptr<Expression> def = nullptr);
std::unique_ptr<Expression> number(std::unique_ptr<Expression>,
std::unique_ptr<Expression> def = nullptr);
std::unique_ptr<Expression> string(std::unique_ptr<Expression>,
diff --git a/include/mbgl/style/expression/parsing_context.hpp b/include/mbgl/style/expression/parsing_context.hpp
index 596b136419..40da7c26d0 100644
--- a/include/mbgl/style/expression/parsing_context.hpp
+++ b/include/mbgl/style/expression/parsing_context.hpp
@@ -93,7 +93,7 @@ public:
Parse the given style-spec JSON value as an expression.
*/
ParseResult parseExpression(const mbgl::style::conversion::Convertible& value,
- optional<TypeAnnotationOption> = {});
+ const optional<TypeAnnotationOption>& = {});
/*
Parse the given style-spec JSON value as an expression intended to be used
@@ -108,8 +108,8 @@ public:
ParseResult parse(const mbgl::style::conversion::Convertible&,
std::size_t,
optional<type::Type> = {},
- optional<TypeAnnotationOption> = {});
-
+ const optional<TypeAnnotationOption>& = {});
+
/*
Parse a child expression. For use by individual Expression::parse() methods.
*/
@@ -168,9 +168,8 @@ private:
type (either Literal, or the one named in value[0]) and dispatching to the
appropriate ParseXxxx::parse(const V&, ParsingContext) method.
*/
- ParseResult parse(const mbgl::style::conversion::Convertible& value,
- optional<TypeAnnotationOption> = {});
-
+ ParseResult parse(const mbgl::style::conversion::Convertible& value, const optional<TypeAnnotationOption>& = {});
+
std::string key;
optional<type::Type> expected;
std::shared_ptr<detail::Scope> scope;
diff --git a/include/mbgl/style/image.hpp b/include/mbgl/style/image.hpp
index dd62d9e0ae..deb4b6f6ce 100644
--- a/include/mbgl/style/image.hpp
+++ b/include/mbgl/style/image.hpp
@@ -34,7 +34,7 @@ public:
bool sdf,
ImageStretches stretchX = {},
ImageStretches stretchY = {},
- optional<ImageContent> content = nullopt);
+ const optional<ImageContent>& content = nullopt);
Image(std::string id,
PremultipliedImage&& image,
float pixelRatio,
diff --git a/include/mbgl/style/sources/custom_geometry_source.hpp b/include/mbgl/style/sources/custom_geometry_source.hpp
index 504ec42ea8..250886c209 100644
--- a/include/mbgl/style/sources/custom_geometry_source.hpp
+++ b/include/mbgl/style/sources/custom_geometry_source.hpp
@@ -37,7 +37,7 @@ public:
TileOptions tileOptions;
};
public:
- CustomGeometrySource(std::string id, CustomGeometrySource::Options options);
+ CustomGeometrySource(std::string id, const CustomGeometrySource::Options& options);
~CustomGeometrySource() final;
void loadDescription(FileSource&) final;
void setTileData(const CanonicalTileID&, const GeoJSON&);
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index 7c75433c6a..9cfcade0ed 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -42,7 +42,7 @@ public:
using TileFeatures = mapbox::feature::feature_collection<int16_t>;
using Features = mapbox::feature::feature_collection<double>;
static std::shared_ptr<GeoJSONData> create(const GeoJSON&,
- Immutable<GeoJSONOptions> = GeoJSONOptions::defaultOptions(),
+ const Immutable<GeoJSONOptions>& = GeoJSONOptions::defaultOptions(),
std::shared_ptr<Scheduler> scheduler = nullptr);
virtual ~GeoJSONData() = default;