From 82288fe20d709c3144411a8d89941dd58ef5e8e2 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 8 Dec 2021 04:14:54 +0100 Subject: [PATCH] chore(event_adder_impl): reuse constant p_size size of pools array will stay the same anyway --- event_adder_impl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/event_adder_impl.h b/event_adder_impl.h index 08f15fa..2d63f4a 100644 --- a/event_adder_impl.h +++ b/event_adder_impl.h @@ -9,22 +9,22 @@ namespace accumulator { class EventAdderImpl final : public EventAdder { private: + static constexpr const uint8_t p_size{32}; int pool; static unsigned int source_id; - static accumulator::Pool pools[32]; + static accumulator::Pool pools[p_size]; public: EventAdderImpl(const unsigned int source_id, const accumulator::Pool pools[32]) { this->source_id = source_id; - static constexpr const uint64_t pools_size{pools.size()}; - for (unsigned int i = 0; i < pools_size; i++) { + for (unsigned int i = 0; i < this->p_size; i++) { this->pools[i] = pools[i]; } this->pool = 0; } void add(std::vector event) override { - this->pool = (this->pool + 1) % pools.size(); + this->pool = (this->pool + 1) % p_size; pools[this->pool].add_entropy(source_id, event); }