{returns the item pointer for s, or nil if not found}\r
function findtree(t:phashtable;s:ansistring):pointer;\r
\r
+{clear a hashtable, deallocating all used resources}\r
+procedure cleartree(t:phashtable);\r
+\r
implementation\r
\r
function makehash(s:ansistring):integer;\r
end;\r
end;\r
\r
+procedure cleartree(t:phashtable);\r
+var\r
+ hash:integer;\r
+ p,p2:thashitem;\r
+begin\r
+ for hash := 0 to hashtable_size-1 do begin\r
+ p := t[hash];\r
+ while p <> nil do begin\r
+ p2 := thashitem(p.next);\r
+ linklistdel(tlinklist(t[hash]),tlinklist(p));\r
+ p.destroy;\r
+ p := thashitem(p2);\r
+ end;\r
+ end;\r
+end;\r
+\r
end.\r