Skip to content

Commit

Permalink
Use std::array for a statically sized vector in `create_serialized_tr…
Browse files Browse the repository at this point in the history
…ie` (#13201)

Finally found a chance to use std::array, and took it!

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #13201
  • Loading branch information
vuule authored Apr 25, 2023
1 parent ac26953 commit 7bbd5ee
Showing 1 changed file with 3 additions and 3 deletions.
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;
};

// Construct a tree-structured trie
Expand Down

0 comments on commit 7bbd5ee

Please sign in to comment.