mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-09 21:27:42 +01:00
LazUtils: Fix the compare functions of lists for integer types in unit IntegerList.
git-svn-id: trunk@56400 -
This commit is contained in:
parent
c7ba603d21
commit
c06635aeeb
@ -47,22 +47,42 @@ implementation
|
||||
|
||||
function CompareByte(const Item1, Item2: Byte): Integer;
|
||||
begin
|
||||
Result := Item1 - Item2;
|
||||
if Item1 > Item2 then
|
||||
Result := 1
|
||||
else if Item1 < Item2 then
|
||||
Result := -1
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function CompareCardinal(const Item1, Item2: Cardinal): Integer;
|
||||
begin
|
||||
Result := Item1 - Item2;
|
||||
if Item1 > Item2 then
|
||||
Result := 1
|
||||
else if Item1 < Item2 then
|
||||
Result := -1
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function CompareInteger(const Item1, Item2: Integer): Integer;
|
||||
begin
|
||||
Result := Item1 - Item2;
|
||||
if Item1 > Item2 then
|
||||
Result := 1
|
||||
else if Item1 < Item2 then
|
||||
Result := -1
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
function CompareInt64(const Item1, Item2: Int64): Integer;
|
||||
begin
|
||||
Result := Item1 - Item2;
|
||||
if Item1 > Item2 then
|
||||
Result := 1
|
||||
else if Item1 < Item2 then
|
||||
Result := -1
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
{ TByteList }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user