[core] Fix clang-analyzer-optin.cplusplus.VirtualCall

Detected by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-04-17 17:53:19 +03:00
parent f82e375bc7
commit 8fb3ea0b53

View File

@@ -16,14 +16,13 @@ public:
GeoJSONFeature(const Feature& feature_, const CanonicalTileID& canonical) : feature(feature_) {
geometry = convertGeometry(feature.geometry, canonical);
// https://github.com/mapbox/geojson-vt-cpp/issues/44
if (getType() == FeatureType::Polygon) {
if (getTypeImpl() == FeatureType::Polygon) {
geometry = fixupPolygons(*geometry);
}
}
FeatureType getType() const override {
return apply_visitor(ToFeatureType(), feature.geometry);
}
FeatureType getType() const override { return getTypeImpl(); }
const PropertyMap& getProperties() const override { return feature.properties; }
FeatureIdentifier getID() const override { return feature.id; }
optional<mbgl::Value> getValue(const std::string& key) const override {
@@ -38,6 +37,9 @@ public:
geometry = GeometryCollection();
return *geometry;
}
private:
FeatureType getTypeImpl() const { return apply_visitor(ToFeatureType(), feature.geometry); }
};
EvaluationResult Expression::evaluate(optional<float> zoom,