~uriboni/compiz/unminimize-configurable-independently

« back to all changes in this revision

Viewing changes to plugins/colorfilter/src/parser.cpp

Fixed various problems described in bug 1030473.
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: https://bugs.launchpad.net/bugs/1030473. Approved by Daniel van Vugt, Sam Spilsbury.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
{
150
150
    CompString arg;
151
151
    CompString string;
152
 
    size_t next, temp, orig;
 
152
    size_t next, orig;
153
153
    int length;
154
154
    CompString retArg;
155
155
 
167
167
    if ((next = string.find (",", pos)) != std::string::npos ||
168
168
        (next = string.find (";", pos)) != std::string::npos)
169
169
    {
 
170
        size_t temp;
170
171
        length = next - pos;
171
172
        if (!length)
172
173
        {