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

« back to all changes in this revision

Viewing changes to plugins/unityshell/src/unityshell.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:
1211
1211
  CompWindowList const& wins = screen->windows();
1212
1212
  for ( CompWindowList::const_reverse_iterator r = wins.rbegin()
1213
1213
      ; r != wins.rend()
1214
 
      ; r++
 
1214
      ; ++r
1215
1215
      )
1216
1216
  {
1217
1217
    CompWindow* w = *r;
1309
1309
                                           ::GLFramebufferObject *fbo,
1310
1310
                                           unsigned int        mask)
1311
1311
{
1312
 
  bool useFbo = false;
1313
 
 
1314
1312
  if (doShellRepaint)
1315
1313
  {
 
1314
    bool useFbo = false;
1316
1315
    oldFbo = fbo->bind ();
1317
1316
    useFbo = fbo->checkStatus () && fbo->tex ();
1318
1317
    if (!useFbo) {
2167
2166
{
2168
2167
  // Look to see if there is a keycode.  If there is, then this isn't a
2169
2168
  // modifier only keybinding.
2170
 
  int key_code = 0;
2171
2169
  if (options[6].type() != CompOption::TypeUnset)
2172
2170
  {
2173
 
    key_code = options[6].value().i();
 
2171
    int key_code = options[6].value().i();
2174
2172
    LOG_DEBUG(logger) << "HUD initiate key code: " << key_code;
2175
2173
    // show it now, no timings or terminate needed.
2176
2174
    return ShowHud();