diff options
author | JP Cimalando <jpcima@users.noreply.github.com> | 2018-05-16 18:27:43 +0200 |
---|---|---|
committer | JP Cimalando <jpcima@users.noreply.github.com> | 2018-05-16 19:35:30 +0200 |
commit | 5b6ec1a766ae922f898a942eade2841a828c0ed0 (patch) | |
tree | a353abda7b39eb6e2c6a7ca6381081721c77f93a /src/adlmidi_bankmap.tcc | |
parent | 5574ad1dbe0195e13eae51b845385d4ed75c0990 (diff) | |
download | libADLMIDI-5b6ec1a766ae922f898a942eade2841a828c0ed0.tar.gz libADLMIDI-5b6ec1a766ae922f898a942eade2841a828c0ed0.tar.bz2 libADLMIDI-5b6ec1a766ae922f898a942eade2841a828c0ed0.zip |
smart pointers cleanup
Diffstat (limited to 'src/adlmidi_bankmap.tcc')
-rw-r--r-- | src/adlmidi_bankmap.tcc | 16 |
1 files changed, 8 insertions, 8 deletions
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<T>::reserve(size_t capacity) m_capacity += need; for(size_t i = need; i-- > 0;) - free_slot(&slots.get()[i]); + free_slot(&slots[i]); } template <class T> @@ -65,7 +65,7 @@ typename BasicBankMap<T>::iterator BasicBankMap<T>::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 <class T> void BasicBankMap<T>::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 <class T> typename BasicBankMap<T>::Slot * BasicBankMap<T>::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 <class T> void BasicBankMap<T>::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 <class T> @@ -255,7 +255,7 @@ void BasicBankMap<T>::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) |