Andreas Kling
2282e89d3f
AK: Use a SinglyLinkedList<T> as HashTable's bucket chain storage.
...
We were using a DoublyLinkedList<T> simply because it supported remove().
This patch consolidates the SinglyLinkedList iterators and adds remove().
2019-06-27 16:36:31 +02:00
Andreas Kling
516d736afe
AK: Consolidate iterators for HashTable and DoublyLinkedList respectively.
...
Get rid of the ConstIterator classes for these containers and use templated
FooIterator<T, ...> and FooIterator<const T, ...> helpers.
This makes the HashTable class a lot easier to read.
2019-06-27 15:57:49 +02:00
Andreas Kling
50700c107f
AK: Get rid of ConstVectorIterator.
...
We can achieve the same with just a VectorIterator<const Vector, const T>.
2019-06-27 14:52:12 +02:00
Andreas Kling
bfaa74f076
AK/Tests: Test Queue<String> with large number of elements.
2019-06-15 10:39:19 +02:00
Andreas Kling
c699d9d79d
AK: Add a simple Queue<T> class.
...
The underlying data structure is a singly-linked list of Vector<T>.
We never shift any of the vector contents around, but we batch the memory
allocations into 1000-element segments.
2019-06-15 10:35:35 +02:00
Andreas Kling
a12751695e
AK/Tests: Add a simple EXPECT_EQ macro and use it for the String test.
2019-06-14 17:52:51 +02:00
Andreas Kling
3557f277f6
AK/Tests: Add some macros for testing.
2019-06-14 17:38:17 +02:00
Andreas Kling
0589ef2886
AK/Tests: Add a couple more String tests.
2019-06-14 07:40:36 +02:00
Andreas Kling
b7cca76ca2
AK: Add an extremely primitive unit test for String.
...
This builds for the host system rather than for Serenity.
We need to improve on it a *lot*, but at least it's a place to start.
2019-06-14 06:42:21 +02:00