瀏覽代碼

+ added TList.Sort overload with a sorting algorithm parameter

git-svn-id: trunk@41169 -
nickysn 6 年之前
父節點
當前提交
e8dc54c768
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 1 0
      rtl/objpas/classes/classesh.inc
  2. 5 0
      rtl/objpas/classes/lists.inc

+ 1 - 0
rtl/objpas/classes/classesh.inc

@@ -340,6 +340,7 @@ Type
     function Remove(Item: Pointer): Integer;
     procedure Pack;
     procedure Sort(Compare: TListSortCompare);
+    procedure Sort(Compare: TListSortCompare; SortingAlgorithm: PSortingAlgorithm);
     property Capacity: Integer read GetCapacity write SetCapacity;
     property Count: Integer read GetCount write SetCount;
     property Items[Index: Integer]: Pointer read Get write Put; default;

+ 5 - 0
rtl/objpas/classes/lists.inc

@@ -774,6 +774,11 @@ begin
   FList.Sort(Compare);
 end;
 
+procedure TList.Sort(Compare: TListSortCompare; SortingAlgorithm: PSortingAlgorithm);
+begin
+  FList.Sort(Compare, SortingAlgorithm);
+end;
+
 procedure TList.CopyMove (aList : TList);
 var r : integer;
 begin