From 43bac17a2986ac2ea86e9d70c61268fa7e90ca4e Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Fri, 30 Aug 2024 20:46:01 +0200 Subject: Fixed many issues with the kernel, and refactored it. Signed-off-by: Amlal EL Mahrouss --- dev/ZKA/NewKit/Array.hxx | 12 ++++++++++-- dev/ZKA/NewKit/NewKit.hxx | 1 - dev/ZKA/NewKit/Ref.hxx | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'dev/ZKA/NewKit') diff --git a/dev/ZKA/NewKit/Array.hxx b/dev/ZKA/NewKit/Array.hxx index dcb6aede..22ee9f6a 100644 --- a/dev/ZKA/NewKit/Array.hxx +++ b/dev/ZKA/NewKit/Array.hxx @@ -37,9 +37,17 @@ namespace Kernel return true; } - SizeT Count() const + const SizeT Count() { - return N; + SizeT count = 0; + + for (SizeT i = 0; i < N; i++) + { + if (fArray[i]) + ++count; + } + + return count; } const T* CData() diff --git a/dev/ZKA/NewKit/NewKit.hxx b/dev/ZKA/NewKit/NewKit.hxx index e7766bde..1daa6af2 100644 --- a/dev/ZKA/NewKit/NewKit.hxx +++ b/dev/ZKA/NewKit/NewKit.hxx @@ -18,5 +18,4 @@ #include #include #include -#include #include diff --git a/dev/ZKA/NewKit/Ref.hxx b/dev/ZKA/NewKit/Ref.hxx index f23cfc08..41f003be 100644 --- a/dev/ZKA/NewKit/Ref.hxx +++ b/dev/ZKA/NewKit/Ref.hxx @@ -37,7 +37,7 @@ namespace Kernel } public: - T& operator->() const + T operator->() const { MUST_PASS(*fClass); return *fClass; -- cgit v1.2.3