diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-10-12 14:20:08 +0300 |
---|---|---|
committer | Yuri Gorshenin <mipt.vi002@gmail.com> | 2017-10-12 15:40:58 +0300 |
commit | b6f415ca49695a5b15f0e8d4870c49627008ec91 (patch) | |
tree | 8886d014e7d3bb9ffce0b7109bd027c96392ae67 /indexer/ftypes_mapping.hpp | |
parent | 1edf04cfdeede071e6fd543d036f028e5c41ad46 (diff) |
[ugc] review fixes
Diffstat (limited to 'indexer/ftypes_mapping.hpp')
-rw-r--r-- | indexer/ftypes_mapping.hpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/indexer/ftypes_mapping.hpp b/indexer/ftypes_mapping.hpp index 5983f8c5e8..7b28bf1716 100644 --- a/indexer/ftypes_mapping.hpp +++ b/indexer/ftypes_mapping.hpp @@ -11,7 +11,10 @@ namespace ftypes { -template <typename Container, bool allowTransitiveDuplications = false> +// When [allowDuplications] is true then we are support duplications in ierarchy, +// for ex. shop and shop-alcohol. shop-alcohol is duplicaton of shop, because shop contains +// shop-alcohol. +template <typename Container, bool allowDuplications = false> class Matcher { public: @@ -47,16 +50,14 @@ public: template <typename Type, typename... Args> void AppendType(Type && type, Args &&... args) { - { #if defined(DEBUG) - if (!allowTransitiveDuplications) + if (!allowDuplications) { feature::TypesHolder holder; holder.Assign(classif().GetTypeByPath(type)); ASSERT(Find(holder) == m_mapping.cend(), ("This type already exists", type)); } #endif - } m_mapping.emplace(classif().GetTypeByPath(std::forward<Type>(type)), std::forward<Args>(args)...); } |