From 7bbd5eeff8a53055ff1d62190746d9d055341032 Mon Sep 17 00:00:00 2001 From: Vukasin Milovanovic Date: Tue, 25 Apr 2023 07:53:28 -0700 Subject: [PATCH] Use std::array for a statically sized vector in `create_serialized_trie` (#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: https://github.com/rapidsai/cudf/pull/13201 --- cpp/src/io/utilities/trie.cu | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/io/utilities/trie.cu b/cpp/src/io/utilities/trie.cu index d902cfecf40..16f32b1ce35 100644 --- a/cpp/src/io/utilities/trie.cu +++ b/cpp/src/io/utilities/trie.cu @@ -40,9 +40,9 @@ rmm::device_uvector create_serialized_trie(const std::vector::max() + 1; struct TreeTrieNode { - using TrieNodePtr = std::unique_ptr; - std::vector children = std::vector(alphabet_size); - bool is_end_of_word = false; + using TrieNodePtr = std::unique_ptr; + std::array children; + bool is_end_of_word = false; }; // Construct a tree-structured trie