Skip to content

Commit

Permalink
refactor: fix error type
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat committed Feb 22, 2022
1 parent 003e606 commit dc6f729
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,17 @@ igraph_error_t igraph_trie_get(igraph_trie_t *t, const char *key, igraph_integer
t->maxvalue = *id;
}
} else {
int ret;
igraph_error_t ret;
igraph_error_handler_t *oldhandler;
oldhandler = igraph_set_error_handler(igraph_error_handler_ignore);
/* Add it to the string vector first, we can undo this later */
ret = igraph_strvector_add(&t->keys, key);
if (ret != 0) {
if (ret != IGRAPH_SUCCESS) {
igraph_set_error_handler(oldhandler);
IGRAPH_ERROR("cannot get element from trie", ret);
}
ret = igraph_i_trie_get_node((igraph_trie_node_t*) t, key, t->maxvalue + 1, id);
if (ret != 0) {
if (ret != IGRAPH_SUCCESS) {
igraph_strvector_resize(&t->keys, igraph_strvector_size(&t->keys) - 1);
igraph_set_error_handler(oldhandler);
IGRAPH_ERROR("cannot get element from trie", ret);
Expand Down

0 comments on commit dc6f729

Please sign in to comment.