Use local constant to avoid repeated range checks (at least in the debug
builds), but also to make the code easier to read and consistent in style
with similar routines in the same package.
gcc/ada/ChangeLog:
* urealp.adb (UR_Negate): Capture array element in a local constant.
---------------
function UR_Negate (Real : Ureal) return Ureal is
+ Val : constant Ureal_Entry := Ureals.Table (Real);
begin
return Store_Ureal
- ((Num => Ureals.Table (Real).Num,
- Den => Ureals.Table (Real).Den,
- Rbase => Ureals.Table (Real).Rbase,
- Negative => not Ureals.Table (Real).Negative));
+ ((Num => Val.Num,
+ Den => Val.Den,
+ Rbase => Val.Rbase,
+ Negative => not Val.Negative));
end UR_Negate;
------------