From: Ketmar Dark Date: Fri, 22 Sep 2017 11:34:25 +0000 (+0300) Subject: fixed tests and tools (new hashtable API) X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=27b74816e87c947e26b9fe2d5cfa90dec63c93a0;p=d2df-sdl.git fixed tests and tools (new hashtable API) --- diff --git a/src/shared/tests/test_hash.dpr b/src/shared/tests/test_hash.dpr index f6a321e..4e70937 100644 --- a/src/shared/tests/test_hash.dpr +++ b/src/shared/tests/test_hash.dpr @@ -9,18 +9,6 @@ const MaxItems = 16384; -{ -function hequ (constref a, b: Integer): Boolean; begin result := (a = b); end; - -function hhash (constref k: Integer): LongWord; -begin - //result := fnvHash(k, sizeof(k)); - //result := u32Hash(LongWord(k)); - result := joaatHash(k, sizeof(k)); -end; -} - - var its: array [0..MaxItems-1] of Integer; marks: array [0..MaxItems-1] of Boolean; @@ -98,8 +86,7 @@ var begin for i := 0 to High(its) do its[i] := -1; - //hash := THashInt.Create(hhash, hequ); - hash := hashNewIntInt(); + hash := THashIntInt.Create(); Randomize(); diff --git a/src/tools/mapgen.dpr b/src/tools/mapgen.dpr index 934713a..40ac72c 100644 --- a/src/tools/mapgen.dpr +++ b/src/tools/mapgen.dpr @@ -18,7 +18,7 @@ uses // ////////////////////////////////////////////////////////////////////////// // type - THashStrFld = specialize THashBase; + THashStrFld = specialize THashBase; // ////////////////////////////////////////////////////////////////////////// // @@ -39,7 +39,7 @@ begin AssignFile(fo, fname); {$I+}Rewrite(fo);{$I-} - fldknown := THashStrFld.Create(hashStrHash, hashStrEqu); + fldknown := THashStrFld.Create(); write(fo, '// trigger cache'#10); for tidx := 0 to dfmapdef.trigTypeCount-1 do @@ -244,7 +244,7 @@ var fldknown: THashStrFld = nil; // key: palias; value: prev field knownfld: TDynField; begin - fldknown := THashStrFld.Create(hashStrHash, hashStrEqu); + fldknown := THashStrFld.Create(); //writeln(getFilenamePath(ParamStr(0)), '|'); e_InitWritelnDriver();