Kaydet (Commit) 34d63e34 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use std::back_inserter

Change-Id: If87f96b5c616ee6ec70de6aa7f2a58c044f04f3a
üst e19242c3
......@@ -20,6 +20,7 @@
#include "sal/config.h"
#include <algorithm>
#include <iterator>
#include <map>
#include <new>
#include <set>
......@@ -712,10 +713,8 @@ strings_v subtract(strings_v const & va, strings_v const & vb) {
strings_v b(vb);
std::sort(b.begin(), b.end());
strings_v::iterator be(std::unique(b.begin(), b.end()));
strings_v c(ae - a.begin());
strings_v::iterator ce(
std::set_difference(a.begin(), ae, b.begin(), be, c.begin()));
c.resize(ce - c.begin());
strings_v c;
std::set_difference(a.begin(), ae, b.begin(), be, std::back_inserter(c));
return c;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment