aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2009-08-17 10:30:39 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-08-17 12:30:39 +0200
commit5f2d216d27bef0ee6f851e1f75d7b79945504ac5 (patch)
tree7a21d420ca26189894adc6664109661232cf267e /gcc
parent1257ae4a477c0e71499dd84331114365ed79fcd0 (diff)
downloadgcc-5f2d216d27bef0ee6f851e1f75d7b79945504ac5.zip
gcc-5f2d216d27bef0ee6f851e1f75d7b79945504ac5.tar.gz
gcc-5f2d216d27bef0ee6f851e1f75d7b79945504ac5.tar.bz2
a-crbtgk.adb, [...]: Minor code reorganization (use conditional expressions)
2009-08-17 Robert Dewar <dewar@adacore.com> * a-crbtgk.adb, a-crdlli.adb, a-direct.adb: Minor code reorganization (use conditional expressions) From-SVN: r150837
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/a-crbtgk.adb14
-rw-r--r--gcc/ada/a-crdlli.adb10
-rw-r--r--gcc/ada/a-direct.adb9
4 files changed, 10 insertions, 30 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 2107917..d77bb1a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,8 +1,9 @@
2009-08-17 Robert Dewar <dewar@adacore.com>
- * a-caldel-vms.adb, a-calend-vms.adb, a-calfor.adb, a-cdlili.adb,
- a-chahan.adb, a-cidlli.adb, a-coinve.adb, a-comlin.adb: Minor code
- reorganization (use conditional expressions).
+ * a-crbtgk.adb, a-crdlli.adb, a-direct.adb, a-caldel-vms.adb,
+ a-calend-vms.adb, a-calfor.adb, a-cdlili.adb, a-chahan.adb,
+ a-cidlli.adb, a-coinve.adb, a-comlin.adb: Minor code reorganization
+ (use conditional expressions).
2009-08-17 Robert Dewar <dewar@adacore.com>
diff --git a/gcc/ada/a-crbtgk.adb b/gcc/ada/a-crbtgk.adb
index c06f31e..59d25be 100644
--- a/gcc/ada/a-crbtgk.adb
+++ b/gcc/ada/a-crbtgk.adb
@@ -125,12 +125,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
while X /= null loop
Y := X;
Inserted := Is_Less_Key_Node (Key, X);
-
- if Inserted then
- X := Ops.Left (X);
- else
- X := Ops.Right (X);
- end if;
+ X := (if Inserted then Ops.Left (X) else Ops.Right (X));
end loop;
-- If Inserted is True, then this means either that Tree is
@@ -440,12 +435,7 @@ package body Ada.Containers.Red_Black_Trees.Generic_Keys is
while X /= null loop
Y := X;
Before := Is_Less_Key_Node (Key, X);
-
- if Before then
- X := Ops.Left (X);
- else
- X := Ops.Right (X);
- end if;
+ X := (if Before then Ops.Left (X) else Ops.Right (X));
end loop;
Insert_Post (Tree, Y, Before, Node);
diff --git a/gcc/ada/a-crdlli.adb b/gcc/ada/a-crdlli.adb
index acdc57d..137290b1 100644
--- a/gcc/ada/a-crdlli.adb
+++ b/gcc/ada/a-crdlli.adb
@@ -561,15 +561,9 @@ package body Ada.Containers.Restricted_Doubly_Linked_Lists is
----------
procedure Sort (Front, Back : Count_Type) is
- Pivot : Count_Type;
-
+ Pivot : constant Count_Type :=
+ (if Front = 0 then Container.First else N (Front).Next);
begin
- if Front = 0 then
- Pivot := Container.First;
- else
- Pivot := N (Front).Next;
- end if;
-
if Pivot /= Back then
Partition (Pivot, Back);
Sort (Front, Pivot);
diff --git a/gcc/ada/a-direct.adb b/gcc/ada/a-direct.adb
index d38745f..f0182c6 100644
--- a/gcc/ada/a-direct.adb
+++ b/gcc/ada/a-direct.adb
@@ -1065,14 +1065,9 @@ package body Ada.Directories is
Cut_End : Natural;
begin
- -- Cut_Start point to the first simple name character
+ -- Cut_Start pointS to the first simple name character
- if Cut_Start = 0 then
- Cut_Start := Path'First;
-
- else
- Cut_Start := Cut_Start + 1;
- end if;
+ Cut_Start := (if Cut_Start = 0 then Path'First else Cut_Start + 1);
-- Cut_End point to the last simple name character