[cairo-bugs] [Bug 12722] New: Use MIN and MAX instead of if statements

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Oct 6 21:14:00 PDT 2007


http://bugs.freedesktop.org/show_bug.cgi?id=12722

           Summary: Use MIN and MAX instead of if statements
           Product: cairo
           Version: 1.5.1
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: bjourne at gmail.com
         QAContact: cairo-bugs at cairographics.org


Quite a few places in cairo uses code like the following:

  if (a > b)
      b = a;

That code is functionally equivalent to:

  b = MAX (a, b);

Which is a more succinct, readable and less error pone version of the above.
So, here is a patch that replaces all instances of the first idiom with the
latter.


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the cairo-bugs mailing list