Formatting changes for StringHashMap PR #5417.

This commit is contained in:
Alexander Kuzmenkov 2019-08-02 19:30:09 +03:00
parent 8fa4575a88
commit 24a8755b82
6 changed files with 9 additions and 24 deletions

View File

@ -90,7 +90,7 @@ public:
auto & set = this->data(place).value;
size_t size = set.size();
writeVarUInt(size, buf);
for (auto & elem : set)
for (const auto & elem : set)
writeIntBinary(elem, buf);
}

View File

@ -34,7 +34,7 @@ namespace
auto & data = res_col->getData();
data.resize(hash_map.size());
for (auto val : hash_map)
for (const auto & val : hash_map)
data[val.getSecond()] = val.getFirst();
for (auto & ind : index)

View File

@ -11,8 +11,8 @@ struct FixedHashMapCell
using State = TState;
using value_type = PairNoInit<Key, Mapped>;
bool full;
Mapped mapped;
bool full;
FixedHashMapCell() {}
FixedHashMapCell(const Key &, const State &) : full(true) {}

View File

@ -128,14 +128,12 @@ struct HashMapCellWithSavedHash : public HashMapCell<Key, TMapped, Hash, TState>
};
template
<
template <
typename Key,
typename Cell,
typename Hash = DefaultHash<Key>,
typename Grower = HashTableGrower<>,
typename Allocator = HashTableAllocator
>
typename Allocator = HashTableAllocator>
class HashMapTable : public HashTable<Key, Cell, Hash, Grower, Allocator>
{
public:
@ -173,23 +171,19 @@ public:
};
template
<
template <
typename Key,
typename Mapped,
typename Hash = DefaultHash<Key>,
typename Grower = HashTableGrower<>,
typename Allocator = HashTableAllocator
>
typename Allocator = HashTableAllocator>
using HashMap = HashMapTable<Key, HashMapCell<Key, Mapped, Hash>, Hash, Grower, Allocator>;
template
<
template <
typename Key,
typename Mapped,
typename Hash = DefaultHash<Key>,
typename Grower = HashTableGrower<>,
typename Allocator = HashTableAllocator
>
typename Allocator = HashTableAllocator>
using HashMapWithSavedHash = HashMapTable<Key, HashMapCellWithSavedHash<Key, Mapped, Hash>, Hash, Grower, Allocator>;

View File

@ -95,7 +95,6 @@ struct HashTableCell
/// Create a cell with the given key / key and value.
HashTableCell(const Key & key_, const State &) : key(key_) {}
/// HashTableCell(const value_type & value_, const State & state) : key(value_) {}
/// Get what the value_type of the container will be.
value_type & getValueMutable() { return key; }

View File

@ -196,8 +196,6 @@ struct AggregationMethodString
using Data = TData;
using Key = typename Data::key_type;
using Mapped = typename Data::mapped_type;
using iterator = typename Data::iterator;
using const_iterator = typename Data::const_iterator;
Data data;
@ -224,8 +222,6 @@ struct AggregationMethodFixedString
using Data = TData;
using Key = typename Data::key_type;
using Mapped = typename Data::mapped_type;
using iterator = typename Data::iterator;
using const_iterator = typename Data::const_iterator;
Data data;
@ -254,8 +250,6 @@ struct AggregationMethodSingleLowCardinalityColumn : public SingleColumnMethod
using Data = typename Base::Data;
using Key = typename Base::Key;
using Mapped = typename Base::Mapped;
using iterator = typename Base::iterator;
using const_iterator = typename Base::const_iterator;
using Base::data;
@ -365,8 +359,6 @@ struct AggregationMethodSerialized
using Data = TData;
using Key = typename Data::key_type;
using Mapped = typename Data::mapped_type;
using iterator = typename Data::iterator;
using const_iterator = typename Data::const_iterator;
Data data;