diff options
author | lloyd <[email protected]> | 2013-07-19 16:30:49 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2013-07-19 16:30:49 +0000 |
commit | 5bdde16c6010d4eac1314b2d56b42fbecc4d6dda (patch) | |
tree | 1c38c103780e1eefecc6261be11520cc958908ea | |
parent | 98ceb0cb0cb46d71d1090f29d859dc99e5b54c5a (diff) |
Rewrite for benefit of Clang analyzer
-rw-r--r-- | src/filters/filter.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/filters/filter.cpp b/src/filters/filter.cpp index 9432f0304..f4b2d34bc 100644 --- a/src/filters/filter.cpp +++ b/src/filters/filter.cpp @@ -104,17 +104,16 @@ Filter* Filter::get_next() const */ void Filter::set_next(Filter* filters[], size_t size) { - while(size && filters && filters[size-1] == nullptr) - --size; - next.clear(); - next.resize(size); port_num = 0; filter_owns = 0; - for(size_t j = 0; j != size; ++j) - next[j] = filters[j]; + while(size && filters && filters[size-1] == 0) + --size; + + if(filters && size) + next.assign(filters, filters + size); } /* |