From b934d9fe4ea021689892197c1bfea6f24ef03222 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Tue, 13 Oct 2020 15:49:58 +0200 Subject: [PATCH] initialize buffer optionally with provided value --- delay.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/delay.hh b/delay.hh index 8206b64..a069586 100644 --- a/delay.hh +++ b/delay.hh @@ -14,10 +14,10 @@ class Delay TYPE buf[NUM]; int pos; public: - Delay() : pos(0) + Delay(TYPE init = 0) : pos(0) { for (int i = 0; i < NUM; ++i) - buf[i] = 0; + buf[i] = init; } TYPE operator () (TYPE input) {