diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-10-30 12:45:47 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-10-30 12:45:47 +0100 |
commit | f11ac8e701b988b82ceb0d5f2fb60a22054b4d9b (patch) | |
tree | d0f85b037631f359a4a611f4fa88beda91f1ace4 /gcc/ada/a-comutr.adb | |
parent | 1572e2c3278eadcf3f22a0731e7530667072d45c (diff) | |
download | gcc-f11ac8e701b988b82ceb0d5f2fb60a22054b4d9b.zip gcc-f11ac8e701b988b82ceb0d5f2fb60a22054b4d9b.tar.gz gcc-f11ac8e701b988b82ceb0d5f2fb60a22054b4d9b.tar.bz2 |
Recommit wrongly reverted change.
From-SVN: r216923
Diffstat (limited to 'gcc/ada/a-comutr.adb')
-rw-r--r-- | gcc/ada/a-comutr.adb | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/gcc/ada/a-comutr.adb b/gcc/ada/a-comutr.adb index 01e7e1c..f45a27a 100644 --- a/gcc/ada/a-comutr.adb +++ b/gcc/ada/a-comutr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2004-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2014, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -272,7 +272,8 @@ package body Ada.Containers.Multiway_Trees is New_Item : Element_Type; Count : Count_Type := 1) is - First, Last : Tree_Node_Access; + First : Tree_Node_Access; + Last : Tree_Node_Access; begin if Parent = No_Element then @@ -297,7 +298,6 @@ package body Ada.Containers.Multiway_Trees is others => <>); Last := First; - for J in Count_Type'(2) .. Count loop -- Reclaim other nodes if Storage_Error. ??? @@ -1171,7 +1171,8 @@ package body Ada.Containers.Multiway_Trees is Position : out Cursor; Count : Count_Type := 1) is - Last : Tree_Node_Access; + First : Tree_Node_Access; + Last : Tree_Node_Access; begin if Parent = No_Element then @@ -1202,13 +1203,11 @@ package body Ada.Containers.Multiway_Trees is with "attempt to tamper with cursors (tree is busy)"; end if; - Position.Container := Parent.Container; - Position.Node := new Tree_Node_Type'(Parent => Parent.Node, - Element => New_Item, - others => <>); - - Last := Position.Node; + First := new Tree_Node_Type'(Parent => Parent.Node, + Element => New_Item, + others => <>); + Last := First; for J in Count_Type'(2) .. Count loop -- Reclaim other nodes if Storage_Error. ??? @@ -1222,7 +1221,7 @@ package body Ada.Containers.Multiway_Trees is end loop; Insert_Subtree_List - (First => Position.Node, + (First => First, Last => Last, Parent => Parent.Node, Before => Before.Node); @@ -1232,6 +1231,8 @@ package body Ada.Containers.Multiway_Trees is -- nodes we just inserted. Container.Count := Container.Count + Count; + + Position := Cursor'(Parent.Container, First); end Insert_Child; procedure Insert_Child @@ -1241,7 +1242,8 @@ package body Ada.Containers.Multiway_Trees is Position : out Cursor; Count : Count_Type := 1) is - Last : Tree_Node_Access; + First : Tree_Node_Access; + Last : Tree_Node_Access; begin if Parent = No_Element then @@ -1272,13 +1274,11 @@ package body Ada.Containers.Multiway_Trees is with "attempt to tamper with cursors (tree is busy)"; end if; - Position.Container := Parent.Container; - Position.Node := new Tree_Node_Type'(Parent => Parent.Node, - Element => <>, - others => <>); - - Last := Position.Node; + First := new Tree_Node_Type'(Parent => Parent.Node, + Element => <>, + others => <>); + Last := First; for J in Count_Type'(2) .. Count loop -- Reclaim other nodes if Storage_Error. ??? @@ -1292,7 +1292,7 @@ package body Ada.Containers.Multiway_Trees is end loop; Insert_Subtree_List - (First => Position.Node, + (First => First, Last => Last, Parent => Parent.Node, Before => Before.Node); @@ -1302,6 +1302,8 @@ package body Ada.Containers.Multiway_Trees is -- nodes we just inserted. Container.Count := Container.Count + Count; + + Position := Cursor'(Parent.Container, First); end Insert_Child; ------------------------- |