diff --git a/compiler/cclasses.pas b/compiler/cclasses.pas index 6e1744b71b..48df07b07c 100644 --- a/compiler/cclasses.pas +++ b/compiler/cclasses.pas @@ -159,6 +159,7 @@ type NextIndex : Integer; Data : Pointer; end; + PHashItem=^THashItem; const MaxHashListSize = Maxint div 16; @@ -195,6 +196,7 @@ type procedure StrExpand(MinIncSize:Integer); procedure SetStrCapacity(NewCapacity: Integer); procedure SetHashCapacity(NewCapacity: Integer); + procedure ReHash; public constructor Create; destructor Destroy; override; @@ -216,6 +218,7 @@ type property Count: Integer read FCount write SetCount; property Items[Index: Integer]: Pointer read Get; default; property List: PHashItemList read FHashList; + property Strs: PChar read FStrs; end; @@ -228,7 +231,7 @@ type TFPHashObject = class private FOwner : TFPHashObjectList; - FIndex : Integer; + FStrIndex : Integer; protected function GetName:string; public @@ -765,47 +768,26 @@ begin end; procedure TFPList.Pack; -Var - {Last,I,J,} - Runner : Longint; +var + NewCount, + i : integer; + pdest, + psrc : PPointer; begin - // Not the fastest; but surely correct - for Runner := Fcount - 1 downto 0 do - if Items[Runner] = Nil then - Self.Delete(Runner); -{ The following may be faster in case of large and defragmented lists - If count=0 then exit; - Runner:=0;I:=0; - TheLast:=Count; - while runnerNil) and (RunnerNil) and (J