mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
sumMapFiltered: use CRTP instead of virtual for keepKey
This commit is contained in:
parent
efb1cb0528
commit
22f7bd03b9
@ -259,7 +259,7 @@ public:
|
||||
|
||||
const char * getHeaderFilePath() const override { return __FILE__; }
|
||||
|
||||
virtual bool keepKey(const T & key) const = 0;
|
||||
bool keepKey(const T & key) const { return static_cast<const Derived &>(*this).keepKey(key); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -272,7 +272,7 @@ public:
|
||||
|
||||
String getName() const override { return "sumMap"; }
|
||||
|
||||
bool keepKey(const T &) const override { return true; }
|
||||
bool keepKey(const T &) const { return true; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@ -295,7 +295,7 @@ public:
|
||||
|
||||
String getName() const override { return "sumMapFiltered"; }
|
||||
|
||||
bool keepKey(const T & key) const override
|
||||
bool keepKey(const T & key) const
|
||||
{
|
||||
return std::binary_search(begin(keys_to_keep), end(keys_to_keep), key);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user