Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Fix formatting expected by sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
ahk committed Dec 5, 2019
1 parent 403df7b commit 190dafc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 32 deletions.
42 changes: 17 additions & 25 deletions src/mbgl/layout/pattern_layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,26 @@ using PatternLayerMap = std::map<std::string, PatternDependency>;
class PatternFeature {
public:
using IndexType = size_t;

PatternFeature(const IndexType& i_, std::unique_ptr<GeometryTileFeature>&& feature_, const PatternLayerMap& patterns_, const float sortKey_) :
i(i_),
feature(std::move(feature_)),
patterns(patterns_),
sortKey(sortKey_)
{}

PatternFeature(PatternFeature&& pt) noexcept :
i(pt.i),
feature(std::move(pt.feature)),
patterns(pt.patterns),
sortKey(pt.sortKey)
{}

PatternFeature& operator=(PatternFeature&& pt) noexcept
{

PatternFeature(const IndexType& i_,
std::unique_ptr<GeometryTileFeature>&& feature_,
const PatternLayerMap& patterns_,
const float sortKey_)
: i(i_), feature(std::move(feature_)), patterns(patterns_), sortKey(sortKey_) {}

PatternFeature(PatternFeature&& pt) noexcept
: i(pt.i), feature(std::move(pt.feature)), patterns(pt.patterns), sortKey(pt.sortKey) {}

PatternFeature& operator=(PatternFeature&& pt) noexcept {
i = pt.i;
feature = std::move(pt.feature);
patterns = pt.patterns;
sortKey = pt.sortKey;
return *this;
}

friend bool operator < (const PatternFeature& lhs, const PatternFeature& rhs) {
return lhs.sortKey < rhs.sortKey;
}


friend bool operator<(const PatternFeature& lhs, const PatternFeature& rhs) { return lhs.sortKey < rhs.sortKey; }

IndexType i;
std::unique_ptr<GeometryTileFeature> feature;
PatternLayerMap patterns;
Expand Down Expand Up @@ -132,9 +124,9 @@ class PatternLayout : public Layout {
}
}
}

auto sortKey = evaluateSortKey<SortKeyPropertyType>(*feature);

PatternFeature patternFeature{i, std::move(feature), patternDependencyMap, sortKey};
const auto sortPosition = std::lower_bound(features.cbegin(), features.cend(), patternFeature);
features.insert(sortPosition, std::move(patternFeature));
Expand Down Expand Up @@ -186,7 +178,7 @@ class PatternLayout : public Layout {
float evaluateSortKey<void>(const GeometryTileFeature&) {
return 0.0;
}

std::map<std::string, Immutable<style::LayerProperties>> layerPropertiesMap;
std::string bucketLeaderID;

Expand Down
3 changes: 1 addition & 2 deletions src/mbgl/style/layers/fill_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ const PropertyValue<float>& FillLayer::getFillSortKey() const {
}

void FillLayer::setFillSortKey(const PropertyValue<float>& value) {
if (value == getFillSortKey())
return;
if (value == getFillSortKey()) return;
auto impl_ = mutableImpl();
impl_->layout.get<FillSortKey>() = value;
baseImpl = std::move(impl_);
Expand Down
4 changes: 1 addition & 3 deletions src/mbgl/style/layers/fill_layer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ namespace style {
bool FillLayer::Impl::hasLayoutDifference(const Layer::Impl& other) const {
assert(other.getTypeInfo() == getTypeInfo());
const auto& impl = static_cast<const style::FillLayer::Impl&>(other);
return filter != impl.filter ||
visibility != impl.visibility ||
layout != impl.layout ||
return filter != impl.filter || visibility != impl.visibility || layout != impl.layout ||
paint.get<FillPattern>().value != impl.paint.get<FillPattern>().value ||
paint.hasDataDrivenPropertyDifference(impl.paint);
}
Expand Down
3 changes: 1 addition & 2 deletions src/mbgl/style/layers/line_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,7 @@ const PropertyValue<float>& LineLayer::getLineSortKey() const {
}

void LineLayer::setLineSortKey(const PropertyValue<float>& value) {
if (value == getLineSortKey())
return;
if (value == getLineSortKey()) return;
auto impl_ = mutableImpl();
impl_->layout.get<LineSortKey>() = value;
baseImpl = std::move(impl_);
Expand Down

0 comments on commit 190dafc

Please sign in to comment.