tries module: fix bug in trie_traverse/2
This commit is contained in:
parent
eab72f6ab7
commit
5d0e404191
@ -50,5 +50,4 @@ trie_dup(Trie, CopyTrie) :-
|
||||
trie_join(CopyTrie, Trie).
|
||||
|
||||
trie_traverse(Trie, Ref) :-
|
||||
trie_get_first_entry(Trie, InitRef),
|
||||
(Ref = InitRef ; trie_traverse(Trie, InitRef, Ref)).
|
||||
trie_traverse(Trie, 0, Ref).
|
||||
|
@ -189,7 +189,11 @@ inline
|
||||
TrData trie_traverse_init(TrEntry trie, TrData init_data) {
|
||||
TrData data;
|
||||
|
||||
if (init_data) {
|
||||
data = TrData_next(init_data);
|
||||
} else {
|
||||
data = TrEntry_first_data(trie);
|
||||
}
|
||||
TrEntry_traverse_data(trie) = data;
|
||||
return data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user