updated hash methods. just increasing the size of the hash helps a lot with loading larger networks. perhaps hash could be extended to dynamically size based on network size.

This commit is contained in:
Sam Hatchett
2014-01-31 11:16:07 -05:00
parent 93036690a0
commit caa794447c
6 changed files with 126 additions and 116 deletions

View File

@@ -423,7 +423,7 @@ int addnodeID(int n, char *id)
{
if (findnode(id)) return(0); /* see EPANET.C */
strncpy(Node[n].ID, id, MAXID);
HTinsert(Nht, Node[n].ID, n); /* see HASH.C */
ENHashTableInsert(NodeHashTable, Node[n].ID, n); /* see HASH.C */
return(1);
}
@@ -440,7 +440,7 @@ int addlinkID(int n, char *id)
{
if (findlink(id)) return(0); /* see EPANET.C */
strncpy(Link[n].ID, id, MAXID);
HTinsert(Lht, Link[n].ID, n); /* see HASH.C */
ENHashTableInsert(LinkHashTable, Link[n].ID, n); /* see HASH.C */
return(1);
}