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

« back to all changes in this revision

Viewing changes to UnityCore/HomeLens.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:
105
105
    /* Any existing categories with offsets >= target_cat_offset must be
106
106
     * pushed up. Update both maps by id and display name */
107
107
    std::map<std::string,unsigned int>::iterator end = reg_by_id_.end();
108
 
    for (i = reg_by_id_.begin(); i != end; i++)
 
108
    for (i = reg_by_id_.begin(); i != end; ++i)
109
109
    {
110
110
      if (i->second >= target_cat_offset)
111
111
      {
114
114
      }
115
115
    }
116
116
 
117
 
    for (i = reg_by_display_name_.begin(), end = reg_by_display_name_.end(); i != end; i++)
 
117
    for (i = reg_by_display_name_.begin(), end = reg_by_display_name_.end(); i != end; ++i)
118
118
    {
119
119
      if (i->second >= target_cat_offset)
120
120
      {
637
637
   * the category offset in the corresponding rows in the target model
638
638
   */
639
639
  for (i = source_to_target_tags_.begin(), end = source_to_target_tags_.end();
640
 
       i != end; i++)
 
640
       i != end; ++i)
641
641
  {
642
642
    source = i->first;
643
643
    target_tag = i->second;