[core] Prefer std::map to std::unordered_map for smaller binary size

This commit is contained in:
John Firebaugh
2017-03-02 14:49:54 -08:00
parent 2dbda72c45
commit c16bd14416
8 changed files with 10 additions and 10 deletions

View File

@@ -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:

View File

@@ -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;
};

View File

@@ -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

View File

@@ -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);

View File

@@ -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_,

View File

@@ -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;

View File

@@ -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>

View File

@@ -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);