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

« back to all changes in this revision

Viewing changes to launcher/LauncherModel.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:
79
79
  iterator it, it2;
80
80
 
81
81
  int i = 0;
82
 
  for (it = main_begin(); it != main_end(); it++)
 
82
  for (it = main_begin(); it != main_end(); ++it)
83
83
  {
84
84
    _inner.push_back(*it);
85
85
    (*it)->SetSortPriority(i);
86
86
    ++i;
87
87
  }
88
88
 
89
 
  for (it = shelf_begin(); it != shelf_end(); it++)
 
89
  for (it = shelf_begin(); it != shelf_end(); ++it)
90
90
  {
91
91
    _inner.push_back(*it);
92
92
    (*it)->SetSortPriority(i);
409
409
  int i;
410
410
 
411
411
  // start currently selected icon
412
 
  for (it = _inner.begin(), i = 0; it != _inner.end(); it++, i++)
 
412
  for (it = _inner.begin(), i = 0; it != _inner.end(); ++it, i++)
413
413
  {
414
414
    if (i == index)
415
415
      return it;