[core] Prefer std::map to std::unordered_map for smaller binary size
This commit is contained in:
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
State state = Pending;
|
||||
|
||||
std::unordered_map<std::string,
|
||||
std::map<std::string,
|
||||
std::pair<style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>> layerPaintProperties;
|
||||
|
||||
private:
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
optional<gl::VertexBuffer<CircleLayoutVertex>> vertexBuffer;
|
||||
optional<gl::IndexBuffer<gl::Triangles>> indexBuffer;
|
||||
|
||||
std::unordered_map<std::string, CircleProgram::PaintPropertyBinders> paintPropertyBinders;
|
||||
std::map<std::string, CircleProgram::PaintPropertyBinders> paintPropertyBinders;
|
||||
|
||||
const MapMode mode;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
optional<gl::IndexBuffer<gl::Lines>> lineIndexBuffer;
|
||||
optional<gl::IndexBuffer<gl::Triangles>> triangleIndexBuffer;
|
||||
|
||||
std::unordered_map<std::string, FillProgram::PaintPropertyBinders> paintPropertyBinders;
|
||||
std::map<std::string, FillProgram::PaintPropertyBinders> paintPropertyBinders;
|
||||
};
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
optional<gl::VertexBuffer<LineLayoutVertex>> vertexBuffer;
|
||||
optional<gl::IndexBuffer<gl::Triangles>> indexBuffer;
|
||||
|
||||
std::unordered_map<std::string, LineProgram::PaintPropertyBinders> paintPropertyBinders;
|
||||
std::map<std::string, LineProgram::PaintPropertyBinders> paintPropertyBinders;
|
||||
|
||||
private:
|
||||
void addGeometry(const GeometryCoordinates&, FeatureType);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace mbgl {
|
||||
using namespace style;
|
||||
|
||||
SymbolBucket::SymbolBucket(style::SymbolLayoutProperties::Evaluated layout_,
|
||||
const std::unordered_map<std::string, std::pair<
|
||||
const std::map<std::string, std::pair<
|
||||
style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>>& layerPaintProperties,
|
||||
float zoom,
|
||||
bool sdfIcons_,
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace mbgl {
|
||||
class SymbolBucket : public Bucket {
|
||||
public:
|
||||
SymbolBucket(style::SymbolLayoutProperties::Evaluated,
|
||||
const std::unordered_map<std::string, std::pair<style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>>&,
|
||||
const std::map<std::string, std::pair<style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>>&,
|
||||
float zoom,
|
||||
bool sdfIcons,
|
||||
bool iconsNeedLinear);
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
const bool sdfIcons;
|
||||
const bool iconsNeedLinear;
|
||||
|
||||
std::unordered_map<std::string, std::pair<
|
||||
std::map<std::string, std::pair<
|
||||
SymbolIconProgram::PaintPropertyBinders,
|
||||
SymbolSDFTextProgram::PaintPropertyBinders>> paintPropertyBinders;
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
std::unordered_map<ClassID, Value> values;
|
||||
std::unordered_map<ClassID, TransitionOptions> transitions;
|
||||
std::map<ClassID, Value> values;
|
||||
std::map<ClassID, TransitionOptions> transitions;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
||||
@@ -61,7 +61,7 @@ TEST(VectorTile, Issue7615) {
|
||||
style::SymbolLayer symbolLayer("symbol", "source");
|
||||
auto symbolBucket = std::make_shared<SymbolBucket>(
|
||||
style::SymbolLayoutProperties::Evaluated(),
|
||||
std::unordered_map<
|
||||
std::map<
|
||||
std::string,
|
||||
std::pair<style::IconPaintProperties::Evaluated, style::TextPaintProperties::Evaluated>>(),
|
||||
0.0f, false, false);
|
||||
|
||||
Reference in New Issue
Block a user