Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::array for a statically sized vector in create_serialized_trie #13201

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cpp/src/io/utilities/trie.cu
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ rmm::device_uvector<serial_trie_node> create_serialized_trie(const std::vector<s

static constexpr int alphabet_size = std::numeric_limits<char>::max() + 1;
struct TreeTrieNode {
using TrieNodePtr = std::unique_ptr<TreeTrieNode>;
std::vector<TrieNodePtr> children = std::vector<TrieNodePtr>(alphabet_size);
bool is_end_of_word = false;
using TrieNodePtr = std::unique_ptr<TreeTrieNode>;
std::array<TrieNodePtr, alphabet_size> children;
bool is_end_of_word = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sound like is_end_of_the_world 😂

};

// Construct a tree-structured trie
Expand Down