Skip to content

Commit

Permalink
Use std::array in partial_queue.
Browse files Browse the repository at this point in the history
  • Loading branch information
rakshasa committed Dec 20, 2024
1 parent b8cb828 commit 6561c00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rak/partial_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#ifndef RAK_PARTIAL_QUEUE_H
#define RAK_PARTIAL_QUEUE_H

#include <array>
#include <cstring>
#include <stdexcept>
#include <cinttypes>
Expand Down Expand Up @@ -107,7 +108,7 @@ class partial_queue {
size_type m_index;
size_type m_ceiling;

size_pair_type m_layers[num_layers];
std::array<size_pair_type, num_layers> m_layers;
};

inline void
Expand Down Expand Up @@ -137,7 +138,7 @@ partial_queue::clear() {
m_index = 0;
m_ceiling = ceiling(num_layers - 1);

std::memset(m_layers, 0, num_layers * sizeof(size_pair_type));
m_layers = {};
}

inline bool
Expand Down

0 comments on commit 6561c00

Please sign in to comment.