~mhr3/unity/places-group-focus-overlay

« back to all changes in this revision

Viewing changes to unity-shared/DashStyle.cpp

  • Committer: Tarmac
  • Author(s): MC Return
  • Date: 2012-08-03 11:58:29 UTC
  • mfrom: (2528.1.22 unity)
  • Revision ID: tarmac-20120803115829-2isyblrrxygwiarj
Optimized performance and style following suggestions reported by cppcheck:

1. Reduced the scope of various variables.

2. Used prefix ++ operators for non-primitive types, because those can be more efficient than post-increment. Post-increment usually keeps a copy of the previous value, adds extra code and is slower.. Fixes: . Approved by Brandon Schaefer, Marco Trevisan (Treviño).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1648
1648
  double height = h - (2.0 * garnish) - 1.0;
1649
1649
 
1650
1650
  bool odd = true;
1651
 
  double radius = 7.0;
1652
1651
 
1653
1652
  // draw the grid background
1654
1653
  {
1656
1655
    cairo_move_to(cr, _align(x + width, odd), y);
1657
1656
    if (curve_bottom)
1658
1657
    {
 
1658
      double radius = 7.0;
1659
1659
      LOG_DEBUG(logger) << "curve: " << _align(x + width, odd) << " - " << _align(y + height - radius, odd);
1660
1660
      // line to bottom-right corner
1661
1661
      cairo_line_to(cr, _align(x + width, odd), _align(y + height - radius, odd));