fixed a small bug where trie replace didn't always work
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401066
This commit is contained in:
+1
-1
@@ -623,7 +623,7 @@ bool sm_trie_add(Trie *trie, const char *key, void *value, bool replace_allowed)
|
|||||||
/* Do an initial browsing to make sure they're not the same string */
|
/* Do an initial browsing to make sure they're not the same string */
|
||||||
if (strcmp(keyptr, term) == 0)
|
if (strcmp(keyptr, term) == 0)
|
||||||
{
|
{
|
||||||
if (!node->valset)
|
if (!node->valset || replace_allowed)
|
||||||
{
|
{
|
||||||
node->valset = true;
|
node->valset = true;
|
||||||
node->value = value;
|
node->value = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user