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

« back to all changes in this revision

Viewing changes to panel/PanelMenuView.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:
700
700
  using namespace panel;
701
701
  cairo_t* cr;
702
702
  cairo_pattern_t* linpat;
703
 
  const int fading_pixels = 35;
704
703
  int x = MAIN_LEFT_PADDING + TITLE_PADDING + geo.x;
705
704
  int y = geo.y;
706
705
 
762
761
  if (text_width > text_space)
763
762
  {
764
763
    int out_pixels = text_width - text_space;
 
764
    const int fading_pixels = 35;
765
765
    int fading_width = out_pixels < fading_pixels ? out_pixels : fading_pixels;
766
766
 
767
767
    cairo_push_group(cr);