1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 12:08:14 +00:00

AK: Prefer using instead of typedef

Problem:
- `typedef` is a keyword which comes from C and carries with it old
  syntax that is hard to read.
- Creating type aliases with the `using` keyword allows for easier
  future maintenance because it supports template syntax.
- There is inconsistent use of `typedef` vs `using`.

Solution:
- Use `clang-tidy`'s checker called `modernize-use-using` to update
  the syntax to use the newer syntax.
- Remove unused functions to make `clang-tidy` happy.
- This results in consistency within the codebase.
This commit is contained in:
Lenny Maiorani 2020-11-11 15:21:01 -07:00 committed by Andreas Kling
parent 6b97118e89
commit f5ced347e6
12 changed files with 83 additions and 93 deletions

View file

@ -67,9 +67,9 @@ public:
}
void remove_one_randomly() { m_table.remove(m_table.begin()); }
typedef HashTable<Entry, EntryTraits> HashTableType;
typedef typename HashTableType::Iterator IteratorType;
typedef typename HashTableType::ConstIterator ConstIteratorType;
using HashTableType = HashTable<Entry, EntryTraits>;
using IteratorType = typename HashTableType::Iterator;
using ConstIteratorType = typename HashTableType::ConstIterator;
IteratorType begin() { return m_table.begin(); }
IteratorType end() { return m_table.end(); }