Merge lp:~mc-return/unity/unity.merge-more-optimizing into lp:unity
| Status: | Merged |
|---|---|
| Approved by: | Tim Penhey on 2012-08-17 |
| Approved revision: | 2549 |
| Merged at revision: | 2580 |
| Proposed branch: | lp:~mc-return/unity/unity.merge-more-optimizing |
| Merge into: | lp:unity |
| Diff against target: |
67 lines (+5/-11) 3 files modified
UnityCore/Indicator.cpp (+1/-7) dash/ResultViewGrid.cpp (+0/-1) unity-shared/PluginAdapterCompiz.cpp (+4/-3) |
| To merge this branch: | bzr merge lp:~mc-return/unity/unity.merge-more-optimizing |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Tim Penhey (community) | 2012-08-05 | Approve on 2012-08-17 | |
| MC Return (community) | Resubmit on 2012-08-08 | ||
|
Review via email:
|
|||
Commit Message
Minor optimizations:
Used 'if (entries_.empty())' instead of 'if (entries_.size() == 0) because it can be faster. xxxx.size() can take linear time while xxxx.empty() is guaranteed to take constant time.
Replaced 'windows.size() > 0' with '!windows.empty()' and '!m_ActionList.
Simplified void Indicator:
Removed redundant parentheses.
Introduced std::size_t num_windows = windows.size(); and changed the if statement in PluginAdapter:
Removed declaration of the unused variable 'next_focused_uri'.
Description of the Change
Various optimizations.
| MC Return (mc-return) wrote : | # |
| Tim Penhey (thumper) wrote : | # |
I know you just changed the logic in UnityCore/
if (!entries_.empty())
instead of the else condition.
In PluginAdapter:
std::size_t num_windows = windows.size();
if (num_windows > 1 || (force && num_windows))
| MC Return (mc-return) wrote : | # |
> I know you just changed the logic in UnityCore/
> isn't needed, so delete the block where we are assigning an empty list into an
> empty list, and just use
> if (!entries_.empty())
> instead of the else condition.
Fixed. Also removed redundant parentheses.
> In PluginAdapter:
> get it once before the if statement.
>
> std::size_t num_windows = windows.size();
> if (num_windows > 1 || (force && num_windows))
Done.
| Unity Merger (unity-merger) wrote : | # |
The Jenkins job https:/
Not merging it.


Please especially check r2543. I am not entirely sure if this commit is correct.