Do not provide mutable key access in hash map cells.

We don't need it anymore after we changed the hash table key memory
management to use callbacks. Removing this interface is important for
hash maps that do not store the key, such as FixedHashMap or the
prospective compound StringHashMap.
This commit is contained in:
Alexander Kuzmenkov 2019-08-08 15:52:18 +03:00
parent abc7fbf6c8
commit 8e9a8584e0
6 changed files with 0 additions and 7 deletions

View File

@ -36,7 +36,6 @@ struct FixedClearableHashMapCell
}
Key key;
FixedClearableHashMapCell * ptr;
Key & getFirstMutable() { return key; }
const Key & getFirst() const { return key; }
Mapped & getSecond() { return ptr->mapped; }
const Mapped & getSecond() const { return *ptr->mapped; }

View File

@ -23,7 +23,6 @@ struct FixedClearableHashTableCell
struct CellExt
{
Key key;
value_type & getValueMutable() { return key; }
const value_type & getValue() const { return key; }
void update(Key && key_, FixedClearableHashTableCell *) { key = key_; }
};

View File

@ -39,7 +39,6 @@ struct FixedHashMapCell
Key key;
FixedHashMapCell * ptr;
Key & getFirstMutable() { return key; }
const Key & getFirst() const { return key; }
Mapped & getSecond() { return ptr->mapped; }
const Mapped & getSecond() const { return ptr->mapped; }

View File

@ -28,7 +28,6 @@ struct FixedHashTableCell
{
Key key;
value_type & getValueMutable() { return key; }
const value_type & getValue() const { return key; }
void update(Key && key_, FixedHashTableCell *) { key = key_; }
};

View File

@ -49,12 +49,10 @@ struct HashMapCell
HashMapCell(const Key & key_, const State &) : value(key_, NoInitTag()) {}
HashMapCell(const value_type & value_, const State &) : value(value_) {}
Key & getFirstMutable() { return value.first; }
const Key & getFirst() const { return value.first; }
Mapped & getSecond() { return value.second; }
const Mapped & getSecond() const { return value.second; }
value_type & getValueMutable() { return value; }
const value_type & getValue() const { return value; }
static const Key & getKey(const value_type & value) { return value.first; }

View File

@ -98,7 +98,6 @@ struct HashTableCell
HashTableCell(const Key & key_, const State &) : key(key_) {}
/// Get what the value_type of the container will be.
value_type & getValueMutable() { return key; }
const value_type & getValue() const { return key; }
/// Get the key.