diff mbox

[Ada] Assign and Copy do not work for ordered and hashed maps

Message ID 20140127164340.GA16425@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Jan. 27, 2014, 4:43 p.m. UTC
Subprograms Assign and Copy in Containers.Ordered_Maps and
Containers.Hashed_Maps were not assigning or copying anything.
This patch fixes that. The test is to use these subprograms with a non
empty Source map and to check that the Target map is not empty.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-01-27  Vincent Celier  <celier@adacore.com>

	* a-coorma.adb, a-cohama.adb (Assign): Copy the Source to the Target,
	not the Target to itself.
diff mbox

Patch

Index: a-coorma.adb
===================================================================
--- a-coorma.adb	(revision 207120)
+++ a-coorma.adb	(working copy)
@@ -274,7 +274,7 @@ 
       end if;
 
       Target.Clear;
-      Insert_Items (Target.Tree);
+      Insert_Items (Source.Tree);
    end Assign;
 
    -------------
Index: a-cohama.adb
===================================================================
--- a-cohama.adb	(revision 207120)
+++ a-cohama.adb	(working copy)
@@ -167,7 +167,7 @@ 
          Target.Reserve_Capacity (Source.Length);
       end if;
 
-      Insert_Items (Target.HT);
+      Insert_Items (Source.HT);
    end Assign;
 
    --------------