diff options
author | Lenny Maiorani <lenny@colorado.edu> | 2020-11-11 15:21:01 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-12 10:19:04 +0100 |
commit | f5ced347e65f06e835fa8f0333d69e803f5a8a72 (patch) | |
tree | 16a8f1a7eba6bd72e65333deca3781c54119cf51 /AK/NonnullPtrVector.h | |
parent | 6b97118e89670f636e9c4de01b10cbab58dcc0db (diff) | |
download | serenity-f5ced347e65f06e835fa8f0333d69e803f5a8a72.zip |
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.
Diffstat (limited to 'AK/NonnullPtrVector.h')
-rw-r--r-- | AK/NonnullPtrVector.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/AK/NonnullPtrVector.h b/AK/NonnullPtrVector.h index 3698015974..31b42102a5 100644 --- a/AK/NonnullPtrVector.h +++ b/AK/NonnullPtrVector.h @@ -32,8 +32,8 @@ namespace AK { template<typename PtrType, int inline_capacity = 0> class NonnullPtrVector : public Vector<PtrType, inline_capacity> { - typedef typename PtrType::ElementType T; - typedef Vector<PtrType, inline_capacity> Base; + using T = typename PtrType::ElementType; + using Base = Vector<PtrType, inline_capacity>; public: NonnullPtrVector() |