About HashTable

Issue #267 resolved
Wenjie Zhou created an issue

For Delphi.

In dwsHashtables.pas

There’s code as follow :

var
HashTable: array[#0..#255] of Byte;
InsensitiveHashTable: array[#0..#255] of Word;

Some thing wrong:

  1. Length(HashTable) = 63734
  2. HashTable[I] := Ord(I); // Because the base type of HashTable is Byte, Then Ord(I) maybe overflow.
  3. ETC.

Comments (2)

  1. Eric Grange repo owner

    You’re right. That unit is legacy though, and serves no purpose outside of very old DWS code. I’ll push a fix, but it might be best to remove it entirely at some point.

  2. Log in to comment