Ada 95 Quality and Style Guide Chapter 10

Chapter 10: Improving Performance - TOC - 10.5 ALGORITHMS

10.5.6 Assigning Alternatives

guideline

  • Use overwriting for conditional assignment when measured performance indicates.

  • example

       -- Using "if .. else"
       if Condition then
          Var := One_Value;
       else
          Var := Other_Value;
       end if;
       -- Using overwriting
       Var := Other_Value;
       if Condition then
          Var := One_Value;
       end if;
    

    rationale

    Determine the impact of styles of assigning alternative values. The examples illustrate two common methods of doing this; for many systems, the performance difference is significant.


    < Previous Page Search Contents Index Next Page >
    1 2 3 4 5 6 7 8 9 10 11
    TOC TOC TOC TOC TOC TOC TOC TOC TOC TOC TOC
    Appendix References Bibliography