From f67cffe63649b413de1aa223dbb749b289529e31 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 21 May 2022 10:13:22 -0700 Subject: [PATCH] add parray::is_filled_with --- src/Text.hh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Text.hh b/src/Text.hh index 409611fb..5fe59040 100644 --- a/src/Text.hh +++ b/src/Text.hh @@ -291,6 +291,15 @@ struct parray { this->items[x] = v; } } + + bool is_filled_with(ItemT v) const { + for (size_t x = 0; x < Count; x++) { + if (this->items[x] != v) { + return false; + } + } + return true; + } } __attribute__((packed));