diff options
author | Yuri Gorshenin <y@maps.me> | 2016-10-13 13:21:25 +0300 |
---|---|---|
committer | Yuri Gorshenin <y@maps.me> | 2016-10-13 13:25:59 +0300 |
commit | a59b30b3da5c46c352922328b28fdc253dd17d01 (patch) | |
tree | 5870ad4ec5a097a2fdb1b1747c0d24f86204939a /search/hotels_filter.cpp | |
parent | cf0df96760583eb3380e9cc7969cbc4dcd8943ab (diff) |
[search] Identity checks for hotels filter.
Diffstat (limited to 'search/hotels_filter.cpp')
-rw-r--r-- | search/hotels_filter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/search/hotels_filter.cpp b/search/hotels_filter.cpp index 10f335a39f..9a64085449 100644 --- a/search/hotels_filter.cpp +++ b/search/hotels_filter.cpp @@ -42,6 +42,23 @@ void Description::FromFeature(FeatureType & ft) } } +// Rule -------------------------------------------------------------------------------------------- +// static +bool Rule::IsIdentical(shared_ptr<Rule> const & lhs, shared_ptr<Rule> const & rhs) +{ + if (lhs && !rhs) + return false; + if (!lhs && rhs) + return false; + + if (lhs && rhs && !lhs->IdenticalTo(*rhs)) + return false; + + return true; +} + +string DebugPrint(Rule const & rule) { return rule.ToString(); } + // HotelsFilter::ScopedFilter ---------------------------------------------------------------------- HotelsFilter::ScopedFilter::ScopedFilter(MwmSet::MwmId const & mwmId, Descriptions const & descriptions, shared_ptr<Rule> rule) |