summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-convec.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 11:09:11 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-13 11:09:11 +0000
commit1a26fe0e8cde9e4ff0c34da9bdc153fbe5e53476 (patch)
tree8bd5d0aa7162506ca6480b411e9b09010ded7668 /gcc/ada/a-convec.adb
parent9bab7a87d4f7039788528e28e49f8a1d3a76b351 (diff)
downloadppe42-gcc-1a26fe0e8cde9e4ff0c34da9bdc153fbe5e53476.tar.gz
ppe42-gcc-1a26fe0e8cde9e4ff0c34da9bdc153fbe5e53476.zip
2011-10-13 Robert Dewar <dewar@adacore.com>
* sem_ch9.adb, sem_util.adb, sem_util.ads, exp_ch6.adb, sem_ch4.adb, sem_ch6.adb, exp_ch3.adb: Minor reformatting. 2011-10-13 Arnaud Charlet <charlet@adacore.com> * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add a-ngcoar.o. 2011-10-13 Jerome Guitton <guitton@adacore.com> * sysdep.c (__gnat_get_task_options): Re-enable VX_SPE_TASK on vThreads 2011-10-13 Eric Botcazou <ebotcazou@adacore.com> * a-convec.ads (Cursor): Minor reformatting. * a-convec.adb (Next): Fix minor inconsistencies. (Previous): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179915 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-convec.adb')
-rw-r--r--gcc/ada/a-convec.adb46
1 files changed, 18 insertions, 28 deletions
diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb
index a357cec8e89..0fd8dee08dd 100644
--- a/gcc/ada/a-convec.adb
+++ b/gcc/ada/a-convec.adb
@@ -2204,24 +2204,18 @@ package body Ada.Containers.Vectors is
function Next (Object : Iterator; Position : Cursor) return Cursor is
begin
- if Position.Index = Object.Container.Last then
- return No_Element;
- else
+ if Position.Index < Object.Container.Last then
return (Object.Container, Position.Index + 1);
+ else
+ return No_Element;
end if;
end Next;
- ----------
- -- Next --
- ----------
-
procedure Next (Position : in out Cursor) is
begin
if Position.Container = null then
return;
- end if;
-
- if Position.Index < Position.Container.Last then
+ elsif Position.Index < Position.Container.Last then
Position.Index := Position.Index + 1;
else
Position := No_Element;
@@ -2253,30 +2247,15 @@ package body Ada.Containers.Vectors is
-- Previous --
--------------
- procedure Previous (Position : in out Cursor) is
- begin
- if Position.Container = null then
- return;
- end if;
-
- if Position.Index > Index_Type'First then
- Position.Index := Position.Index - 1;
- else
- Position := No_Element;
- end if;
- end Previous;
-
function Previous (Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
- end if;
-
- if Position.Index > Index_Type'First then
+ elsif Position.Index > Index_Type'First then
return (Position.Container, Position.Index - 1);
+ else
+ return No_Element;
end if;
-
- return No_Element;
end Previous;
function Previous (Object : Iterator; Position : Cursor) return Cursor is
@@ -2288,6 +2267,17 @@ package body Ada.Containers.Vectors is
end if;
end Previous;
+ procedure Previous (Position : in out Cursor) is
+ begin
+ if Position.Container = null then
+ return;
+ elsif Position.Index > Index_Type'First then
+ Position.Index := Position.Index - 1;
+ else
+ Position := No_Element;
+ end if;
+ end Previous;
+
-------------------
-- Query_Element --
-------------------
OpenPOWER on IntegriCloud