a-crbtgk.adb, [...]: Minor code reorganization (use conditional expressions)
authorRobert Dewar <dewar@adacore.com>
Mon, 17 Aug 2009 10:30:39 +0000 (10:30 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 17 Aug 2009 10:30:39 +0000 (12:30 +0200)
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

gcc/ada/ChangeLog
gcc/ada/a-crbtgk.adb
gcc/ada/a-crdlli.adb
gcc/ada/a-direct.adb

index 2107917f803ebcec3cbdcaaabfe30fd965e17155..d77bb1afbf4b7c95cb04a72421549514be5a8a66 100644 (file)
@@ -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>
 
index c06f31e1d0731fe7f1795ef0d0decdae2f198708..59d25be4557139f2fa1233ad3bf63f3ae6351f71 100644 (file)
@@ -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);
index acdc57d1a08541f361dc3c8ee53f0a9375bef5b8..137290b11e0885c9d978587031d6357efc113e7f 100644 (file)
@@ -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);
index d38745fbd8bde8bc8036c70e64706ae2327ad8f8..f0182c68e7a159841d06f5aae309dd1573de998a 100644 (file)
@@ -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