Skip to content

Commit

Permalink
Revert "I thought the {} does the initialization, but let’s be sure."
Browse files Browse the repository at this point in the history
This reverts commit f390d17.
  • Loading branch information
smarr committed Jan 11, 2024
1 parent 6ab70ee commit 315fe02
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions benchmarks/C++/src/som/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,9 @@ class Dictionary {
uint32_t _size{0};
uint32_t _capacity;

static Entry** createInitialized(uint32_t capacity) {
auto* buckets = new Entry* [capacity] {};
for (uint32_t i = 0; i < capacity; i += 1) {
buckets[i] = nullptr;
}
return buckets;
}

public:
explicit Dictionary(uint32_t capacity = INITIAL_CAPACITY)
: _buckets(createInitialized(capacity)), _capacity(capacity) {}
: _buckets(new Entry* [capacity] {}), _capacity(capacity) {}

virtual ~Dictionary() {
removeAll();
Expand Down

0 comments on commit 315fe02

Please sign in to comment.