[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:
Al
2016-08-16 13:11:45 -04:00
parent 92e66fd60c
commit 330edc2c93
2 changed files with 1 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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