From fb790b07aeba8e22e4190cf3e1834d11ecde6c96 Mon Sep 17 00:00:00 2001 From: Amlal Date: Fri, 25 Apr 2025 13:08:33 +0200 Subject: dev: better .clang-format, ran format command. Signed-off-by: Amlal --- dev/kernel/NewKit/ArrayList.h | 89 +++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 54 deletions(-) (limited to 'dev/kernel/NewKit/ArrayList.h') diff --git a/dev/kernel/NewKit/ArrayList.h b/dev/kernel/NewKit/ArrayList.h index 1ea69fc5..d07e534c 100644 --- a/dev/kernel/NewKit/ArrayList.h +++ b/dev/kernel/NewKit/ArrayList.h @@ -1,6 +1,6 @@ /* ------------------------------------------- - Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. + Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved. ------------------------------------------- */ @@ -8,56 +8,37 @@ #include -namespace Kernel -{ - template - class ArrayList final - { - public: - explicit ArrayList(T* list, SizeT length) - : fList(reinterpret_cast(list)) - { - } - - ~ArrayList() = default; - - ArrayList& operator=(const ArrayList&) = default; - ArrayList(const ArrayList&) = default; - - T* Data() - { - return fList; - } - - const T* CData() - { - return fList; - } - - T& operator[](SizeT index) const - { - MUST_PASS(index < this->Count()); - return fList[index]; - } - - operator bool() - { - return fList; - } - - SizeT Count() const - { - return fLen; - } - - private: - T* fList{nullptr}; - SizeT fLen{0}; - }; - - template - ArrayList make_list(ValueType val) - { - return ArrayList{val}; - } -} // namespace Kernel +namespace Kernel { +template +class ArrayList final { + public: + explicit ArrayList(T* list, SizeT length) : fList(reinterpret_cast(list)) {} + + ~ArrayList() = default; + + ArrayList& operator=(const ArrayList&) = default; + ArrayList(const ArrayList&) = default; + + T* Data() { return fList; } + + const T* CData() { return fList; } + + T& operator[](SizeT index) const { + MUST_PASS(index < this->Count()); + return fList[index]; + } + + operator bool() { return fList; } + + SizeT Count() const { return fLen; } + + private: + T* fList{nullptr}; + SizeT fLen{0}; +}; + +template +ArrayList make_list(ValueType val) { + return ArrayList{val}; +} +} // namespace Kernel -- cgit v1.2.3