Merge pull request #39316 from Anutrix/remove-hashmap-reduntant-func

Remove unused function get_key_value_ptr_array from hash_map.h and another tiny fix.
This commit is contained in:
Rémi Verschelde 2020-06-05 11:53:54 +02:00 committed by GitHub
commit 50cb781b1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 16 deletions

View File

@ -524,28 +524,14 @@ public:
copy_from(p_table);
}
void get_key_value_ptr_array(const Pair **p_pairs) const {
void get_key_list(List<TKey> *r_keys) const {
if (unlikely(!hash_table)) {
return;
}
for (int i = 0; i < (1 << hash_table_power); i++) {
Element *e = hash_table[i];
while (e) {
*p_pairs = &e->pair;
p_pairs++;
e = e->next;
}
}
}
void get_key_list(List<TKey> *p_keys) const {
if (unlikely(!hash_table)) {
return;
}
for (int i = 0; i < (1 << hash_table_power); i++) {
Element *e = hash_table[i];
while (e) {
p_keys->push_back(e->pair.key);
r_keys->push_back(e->pair.key);
e = e->next;
}
}