1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

AK: Remove bitrotted Traits::dump() mechanism

This was only used by HashTable::dump() which I used when doing the
first HashTable implementation. Removing this allows us to also remove
most includes of <AK/kstdio.h>.
This commit is contained in:
Andreas Kling 2020-02-10 11:55:34 +01:00
parent c8eaae3eaf
commit 6cbd72f54f
24 changed files with 3 additions and 63 deletions

View file

@ -31,7 +31,6 @@
#include <AK/StdLibExtras.h>
#include <AK/TemporaryChange.h>
#include <AK/Traits.h>
#include <AK/kstdio.h>
namespace AK {
@ -163,8 +162,6 @@ public:
bool contains(const T&) const;
void clear();
void dump() const;
using Iterator = HashTableIterator<HashTable, T, typename Bucket::Iterator>;
friend Iterator;
Iterator begin() { return Iterator(*this, is_empty()); }
@ -380,21 +377,6 @@ auto HashTable<T, TraitsForT>::lookup(const T& value, int* bucket_index) const -
return m_buckets[hash % m_capacity];
}
template<typename T, typename TraitsForT>
void HashTable<T, TraitsForT>::dump() const
{
kprintf("HashTable{%p} m_size=%u, m_capacity=%u, m_buckets=%p\n", this, m_size, m_capacity, m_buckets);
for (int i = 0; i < m_capacity; ++i) {
auto& bucket = m_buckets[i];
kprintf("Bucket %u\n", i);
for (auto& e : bucket) {
kprintf(" > ");
TraitsForT::dump(e);
kprintf("\n");
}
}
}
}
using AK::HashTable;