fix h_stringmap_replace for the all-values case
This commit is contained in:
parent
e5ee61029c
commit
faebe355a8
1 changed files with 7 additions and 5 deletions
|
|
@ -271,11 +271,13 @@ void h_stringmap_update(HCFStringMap *m, const HCFStringMap *n)
|
||||||
*/
|
*/
|
||||||
void h_stringmap_replace(HCFStringMap *m, void *old, void *new)
|
void h_stringmap_replace(HCFStringMap *m, void *old, void *new)
|
||||||
{
|
{
|
||||||
if(!old || m->epsilon_branch == old)
|
if(!old) {
|
||||||
m->epsilon_branch = new;
|
if(m->epsilon_branch) m->epsilon_branch = new;
|
||||||
|
if(m->end_branch) m->end_branch = new;
|
||||||
if(!old || m->end_branch == old)
|
} else {
|
||||||
m->end_branch = new;
|
if(m->epsilon_branch == old) m->epsilon_branch = new;
|
||||||
|
if(m->end_branch == old) m->end_branch = new;
|
||||||
|
}
|
||||||
|
|
||||||
// iterate over m->char_branches
|
// iterate over m->char_branches
|
||||||
const HHashTable *ht = m->char_branches;
|
const HHashTable *ht = m->char_branches;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue