From 4e4f7ddbb1a23399a3b06b7b745a1261862ee5f5 Mon Sep 17 00:00:00 2001 From: rolandreichweinbmw Date: Sat, 1 Mar 2025 18:57:27 +0100 Subject: [PATCH] Cleanup (#1039) --- include/etl/bit_stream.h | 6 +++--- include/etl/intrusive_forward_list.h | 6 +----- include/etl/private/delegate_cpp03.h | 10 +++++----- include/etl/vector.h | 1 - 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/include/etl/bit_stream.h b/include/etl/bit_stream.h index 7c5b557ef..b58c58820 100644 --- a/include/etl/bit_stream.h +++ b/include/etl/bit_stream.h @@ -236,8 +236,8 @@ namespace etl while (nbits != 0) { unsigned char mask_width = static_cast(etl::min(nbits, bits_available_in_char)); - - typedef typename etl::make_unsigned::type chunk_t; + + typedef typename etl::make_unsigned::type chunk_t; chunk_t chunk = get_chunk(mask_width); nbits -= mask_width; @@ -529,7 +529,7 @@ namespace etl typedef char value_type; typedef value_type* iterator; - typedef const value_type* const_iterator; + typedef const value_type* const_iterator; typedef etl::span callback_parameter_type; typedef etl::delegate callback_type; diff --git a/include/etl/intrusive_forward_list.h b/include/etl/intrusive_forward_list.h index a466337f1..929a69d03 100644 --- a/include/etl/intrusive_forward_list.h +++ b/include/etl/intrusive_forward_list.h @@ -351,11 +351,7 @@ namespace etl } p_previous = p_link; - - if (p_link != ETL_NULLPTR) - { - p_link = p_link->link_type::etl_next; - } + p_link = p_link->link_type::etl_next; } return ETL_NULLPTR; diff --git a/include/etl/private/delegate_cpp03.h b/include/etl/private/delegate_cpp03.h index 250fff6f6..382e6504f 100644 --- a/include/etl/private/delegate_cpp03.h +++ b/include/etl/private/delegate_cpp03.h @@ -66,11 +66,11 @@ namespace etl //*********************************** template struct call_if_impl - { + { etl::optional call_if(TParam param) { - TDelegate& d = static_cast(*this); - + TDelegate& d = static_cast(*this); + etl::optional result; if (d.is_valid()) @@ -88,8 +88,8 @@ namespace etl { bool call_if() { - TDelegate& d = static_cast(*this); - + TDelegate& d = static_cast(*this); + if (d.is_valid()) { d(); diff --git a/include/etl/vector.h b/include/etl/vector.h index 80994bd58..f2c1b6461 100644 --- a/include/etl/vector.h +++ b/include/etl/vector.h @@ -47,7 +47,6 @@ SOFTWARE. #include "functional.h" #include "static_assert.h" #include "placement_new.h" -#include "algorithm.h" #include "initializer_list.h" #include