added missing initialization

This commit is contained in:
thrust26 2017-10-08 14:18:14 +02:00
parent 649dada32c
commit eb2ae18ce1
1 changed files with 5 additions and 1 deletions

View File

@ -32,7 +32,11 @@ public:
void remove(const uInt16 address) { myCount[address]--; }
//void toggle(uInt16 address) { myCount[address] ? remove(address) : add(address); } // TODO condition
void initialize() { myInitialized = true; }
void initialize() {
if(!myInitialized)
memset(myCount, 0, sizeof(myCount));
myInitialized = true;
}
void clearAll() { myInitialized = false; memset(myCount, 0, sizeof(myCount)); }
bool isInitialized() const { return myInitialized; }