View Issue Details

IDProjectCategoryView StatusLast Update
0035921FPCRTLpublic2019-08-02 15:16
ReporterMaciej IzakAssigned ToSven Barth 
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.3.1Product Build 
Target VersionFixed in Version3.3.1 
Summary0035921: [patch] more consistent API for rtl-generics rename ExtractNode to Extract
DescriptionHello,

we need more consistent API for rtl-generics related to AVLTrees, so the right path is to rename ExtractNode to Extract (my failure during api design). This is also needed to allow easily omit the error:

Can't determine which overloaded function to call

This happens very often during work with current AVLTrees from rtl-generics. This patch is also needed for further patches.
TagsNo tags attached.
Fixed in Revision42556
FPCOldBugId
FPCTarget-
Attached Files
  • generics.collections.pas.patch (1,355 bytes)
    Index: packages/rtl-generics/src/generics.collections.pas
    ===================================================================
    --- packages/rtl-generics/src/generics.collections.pas	(revision 42554)
    +++ packages/rtl-generics/src/generics.collections.pas	(working copy)
    @@ -747,8 +747,8 @@
         function Remove(constref AKey: TKey; ADisposeNode: boolean = true): boolean;
         function ExtractPair(constref AKey: TKey; ADisposeNode: boolean = true): TTreePair; overload;
         function ExtractPair(constref ANode: PNode; ADispose: boolean = true): TTreePair; overload;
    -    function ExtractNode(constref AKey: TKey; ADisposeNode: boolean): PNode; overload;
    -    function ExtractNode(ANode: PNode; ADispose: boolean): PNode; overload;
    +    function Extract(constref AKey: TKey; ADisposeNode: boolean): PNode;
    +    function ExtractNode(ANode: PNode; ADispose: boolean): PNode;
         procedure Delete(ANode: PNode; ADispose: boolean = true); inline;
     
         function GetEnumerator: TPairEnumerator;
    @@ -3430,7 +3430,7 @@
       Result.Value := DoRemove(ANode, cnExtracted, ADispose);
     end;
     
    -function TCustomAVLTreeMap<TREE_CONSTRAINTS>.ExtractNode(constref AKey: TKey; ADisposeNode: boolean): PNode;
    +function TCustomAVLTreeMap<TREE_CONSTRAINTS>.Extract(constref AKey: TKey; ADisposeNode: boolean): PNode;
     begin
       Result:=Find(AKey);
       if Result<>nil then
    

Activities

Maciej Izak

2019-08-02 10:04

reporter  

generics.collections.pas.patch (1,355 bytes)
Index: packages/rtl-generics/src/generics.collections.pas
===================================================================
--- packages/rtl-generics/src/generics.collections.pas	(revision 42554)
+++ packages/rtl-generics/src/generics.collections.pas	(working copy)
@@ -747,8 +747,8 @@
     function Remove(constref AKey: TKey; ADisposeNode: boolean = true): boolean;
     function ExtractPair(constref AKey: TKey; ADisposeNode: boolean = true): TTreePair; overload;
     function ExtractPair(constref ANode: PNode; ADispose: boolean = true): TTreePair; overload;
-    function ExtractNode(constref AKey: TKey; ADisposeNode: boolean): PNode; overload;
-    function ExtractNode(ANode: PNode; ADispose: boolean): PNode; overload;
+    function Extract(constref AKey: TKey; ADisposeNode: boolean): PNode;
+    function ExtractNode(ANode: PNode; ADispose: boolean): PNode;
     procedure Delete(ANode: PNode; ADispose: boolean = true); inline;
 
     function GetEnumerator: TPairEnumerator;
@@ -3430,7 +3430,7 @@
   Result.Value := DoRemove(ANode, cnExtracted, ADispose);
 end;
 
-function TCustomAVLTreeMap<TREE_CONSTRAINTS>.ExtractNode(constref AKey: TKey; ADisposeNode: boolean): PNode;
+function TCustomAVLTreeMap<TREE_CONSTRAINTS>.Extract(constref AKey: TKey; ADisposeNode: boolean): PNode;
 begin
   Result:=Find(AKey);
   if Result<>nil then

Sven Barth

2019-08-02 15:16

manager   ~0117542

Please test and close if okay.

Issue History

Date Modified Username Field Change
2019-08-02 10:04 Maciej Izak New Issue
2019-08-02 10:04 Maciej Izak File Added: generics.collections.pas.patch
2019-08-02 14:36 Sven Barth Assigned To => Sven Barth
2019-08-02 14:36 Sven Barth Status new => assigned
2019-08-02 15:16 Sven Barth Status assigned => resolved
2019-08-02 15:16 Sven Barth Resolution open => fixed
2019-08-02 15:16 Sven Barth Fixed in Version => 3.3.1
2019-08-02 15:16 Sven Barth Fixed in Revision => 42556
2019-08-02 15:16 Sven Barth FPCTarget => -
2019-08-02 15:16 Sven Barth Note Added: 0117542