From 5b6ec1a766ae922f898a942eade2841a828c0ed0 Mon Sep 17 00:00:00 2001 From: JP Cimalando Date: Wed, 16 May 2018 18:27:43 +0200 Subject: smart pointers cleanup --- src/adlmidi_bankmap.tcc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/adlmidi_bankmap.tcc') diff --git a/src/adlmidi_bankmap.tcc b/src/adlmidi_bankmap.tcc index 0387418..938192d 100644 --- a/src/adlmidi_bankmap.tcc +++ b/src/adlmidi_bankmap.tcc @@ -57,7 +57,7 @@ void BasicBankMap::reserve(size_t capacity) m_capacity += need; for(size_t i = need; i-- > 0;) - free_slot(&slots.get()[i]); + free_slot(&slots[i]); } template @@ -65,7 +65,7 @@ typename BasicBankMap::iterator BasicBankMap::begin() const { iterator it(m_buckets.get(), NULL, 0); - while(it.index < hash_buckets && !(it.slot = m_buckets.get()[it.index])) + while(it.index < hash_buckets && !(it.slot = m_buckets[it.index])) ++it.index; return it; } @@ -176,12 +176,12 @@ template void BasicBankMap::clear() { for(size_t i = 0; i < hash_buckets; ++i) { - Slot *slot = m_buckets.get()[i]; + Slot *slot = m_buckets[i]; while (Slot *cur = slot) { slot = slot->next; free_slot(cur); } - m_buckets.get()[i] = NULL; + m_buckets[i] = NULL; } m_size = 0; } @@ -231,7 +231,7 @@ template typename BasicBankMap::Slot * BasicBankMap::bucket_find(size_t index, key_type key) { - Slot *slot = m_buckets.get()[index]; + Slot *slot = m_buckets[index]; while(slot && slot->value.first != key) slot = slot->next; return slot; @@ -241,11 +241,11 @@ template void BasicBankMap::bucket_add(size_t index, Slot *slot) { assert(slot); - Slot *next = m_buckets.get()[index]; + Slot *next = m_buckets[index]; if(next) next->prev = slot; slot->next = next; - m_buckets.get()[index] = slot; + m_buckets[index] = slot; } template @@ -255,7 +255,7 @@ void BasicBankMap::bucket_remove(size_t index, Slot *slot) Slot *prev = slot->prev; Slot *next = slot->next; if(!prev) - m_buckets.get()[index] = next; + m_buckets[index] = next; else prev->next = next; if(next) -- cgit v1.2.3