[utils] cstring_array_get_phrase requires a char_array to be passed in so it doesn't have to do any memory allocation
This commit is contained in:
@@ -774,7 +774,7 @@ inline phrase_t trie_search_prefixes(trie_t *self, char *word, size_t len) {
|
||||
}
|
||||
|
||||
|
||||
inline char *cstring_array_get_phrase_with_char_array(cstring_array *str, char_array *phrase_tokens, phrase_t phrase) {
|
||||
inline char *cstring_array_get_phrase(cstring_array *str, char_array *phrase_tokens, phrase_t phrase) {
|
||||
char_array_clear(phrase_tokens);
|
||||
|
||||
size_t phrase_end = phrase.start + phrase.len;
|
||||
@@ -791,9 +791,3 @@ inline char *cstring_array_get_phrase_with_char_array(cstring_array *str, char_a
|
||||
return char_array_get_string(phrase_tokens);
|
||||
}
|
||||
|
||||
|
||||
inline char *cstring_array_get_phrase(tokenized_string_t *str, char_array *phrase_tokens, phrase_t phrase) {
|
||||
return cstring_array_get_phrase_with_char_array(str->strings, phrase_tokens, phrase);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ phrase_t trie_search_prefixes_from_index(trie_t *self, char *word, size_t len, u
|
||||
phrase_t trie_search_prefixes_from_index_get_prefix_char(trie_t *self, char *word, size_t len, uint32_t start_node_id);
|
||||
phrase_t trie_search_prefixes(trie_t *self, char *word, size_t len);
|
||||
|
||||
char *cstring_array_get_phrase_with_char_array(cstring_array *str, char_array *phrase_tokens, phrase_t phrase);
|
||||
char *cstring_array_get_phrase(tokenized_string_t *str, char_array *phrase_tokens, phrase_t phrase);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user