Skip to content

Issue for dwsHashtables.pas #14

Description

@achinastone

There's some code in dwsHashtables.pas.

procedure InitTables;
var
I, K: Char;
Temp: Integer;
begin
for I := #0 to #255 do
begin
HashTable[I] := Ord(I);
InsensitiveHashTable[I] := Ord(AnsiUpperCase(Char(I))[1]);
end;
RandSeed := 111;
for I := #1 to #255 do
begin
repeat
K := Char(Random(255));
until K <> #0;
Temp := HashTable[I];
HashTable[I] := HashTable[K];
HashTable[K] := Temp;
end;
end;

I test the code as follow in Delphi 12. The result shows 63734.

procedure TForm2.FormCreate(Sender: TObject);
var
I: Char;
v: Integer;
begin
v := 0;
for I := #0 to #255 do
begin
Inc(v);
end;
ShowMessage(v.ToString);
end;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions