summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae58c60)
raw | patch | inline | side by side (parent: ae58c60)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 22 Sep 2017 11:34:25 +0000 (14:34 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 22 Sep 2017 11:34:46 +0000 (14:34 +0300) |
src/shared/tests/test_hash.dpr | patch | blob | history | |
src/tools/mapgen.dpr | patch | blob | history |
index f6a321ed8c27323ffb4e1443975298845904b970..4e709373aa623f965b1c2b717c46e3337379a7f9 100644 (file)
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;
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 934713ab46451b37bd197a80c67cb23d3a8b0e63..40ac72ce915865d1cc712111c3b0021f1367c09e 100644 (file)
--- a/src/tools/mapgen.dpr
+++ b/src/tools/mapgen.dpr
// ////////////////////////////////////////////////////////////////////////// //
type
- THashStrFld = specialize THashBase<AnsiString, TDynField>;
+ THashStrFld = specialize THashBase<AnsiString, TDynField, THashKeyStr>;
// ////////////////////////////////////////////////////////////////////////// //
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
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();