Prefer emplace_back to push_back

* spot/graph/ngraph.hh, spot/ltsmin/ltsmin.cc,
spot/misc/bitvect.hh, spot/misc/intvcomp.cc,
spot/misc/satsolver.cc, spot/priv/weight.cc,
spot/ta/taexplicit.cc, spot/taalgos/minimize.cc,
spot/taalgos/reachiter.cc, spot/tl/exclusive.cc,
spot/tl/formula.cc, spot/tl/formula.hh,
spot/tl/mark.cc, spot/tl/mutation.cc,
spot/tl/relabel.cc, spot/tl/remove_x.cc,
spot/tl/simplify.cc, spot/twa/acc.cc,
spot/twa/acc.hh, spot/twa/formula2bdd.cc,
spot/twa/taatgba.cc, spot/twa/taatgba.hh,
spot/twa/twa.hh, spot/twa/twagraph.cc,
spot/twaalgos/bfssteps.cc, spot/twaalgos/canonicalize.cc,
spot/twaalgos/compsusp.cc, spot/twaalgos/copy.cc,
spot/twaalgos/cycles.cc, spot/twaalgos/degen.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/emptiness.cc, spot/twaalgos/gv04.cc,
spot/twaalgos/hoa.cc, spot/twaalgos/ltl2taa.cc,
spot/twaalgos/ltl2tgba_fm.cc, spot/twaalgos/magic.cc,
spot/twaalgos/mask.hh, spot/twaalgos/minimize.cc,
spot/twaalgos/powerset.cc, spot/twaalgos/product.cc,
spot/twaalgos/randomgraph.cc, spot/twaalgos/reachiter.cc,
spot/twaalgos/relabel.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/sccfilter.cc, spot/twaalgos/se05.cc,
spot/twaalgos/simulation.cc, spot/twaalgos/stutter.cc,
spot/twaalgos/tau03opt.cc, spot/twaalgos/totgba.cc,
spot/twaalgos/word.cc, tests/core/bitvect.cc: here.
This commit is contained in:
Etienne Renault 2016-11-22 10:21:08 +01:00
parent ef214b2c42
commit 43ec36cda7
54 changed files with 310 additions and 310 deletions

View file

@ -519,7 +519,7 @@ namespace spot
}
}
for (auto i: p)
pairs.push_back(i.second);
pairs.emplace_back(i.second);
return (!(seen_fin & seen_inf)
&& (seen_fin | seen_inf) == all_sets());
}
@ -568,7 +568,7 @@ namespace spot
codes.reserve(n_accs);
for (unsigned i = 0; i < n_accs; ++i)
{
codes.push_back(drand() < 0.5 ? inf({i}) : fin({i}));
codes.emplace_back(drand() < 0.5 ? inf({i}) : fin({i}));
if (reuse > 0.0 && drand() < reuse)
--i;
}
@ -664,9 +664,9 @@ namespace spot
std::vector<bdd> r;
for (unsigned i = 0; r.size() < umax; ++i)
if (used.has(i))
r.push_back(bdd_ithvar(base++));
r.emplace_back(bdd_ithvar(base++));
else
r.push_back(bddfalse);
r.emplace_back(bddfalse);
return to_bdd_rec(&lhs.back(), &r[0]) == to_bdd_rec(&rhs.back(), &r[0]);
}
}
@ -740,11 +740,11 @@ namespace spot
if (used.has(i))
{
sets[base] = i;
r.push_back(bdd_ithvar(base++));
r.emplace_back(bdd_ithvar(base++));
}
else
{
r.push_back(bddfalse);
r.emplace_back(bddfalse);
}
}
@ -812,11 +812,11 @@ namespace spot
if (used.has(i))
{
sets[base] = i;
r.push_back(bdd_ithvar(base++));
r.emplace_back(bdd_ithvar(base++));
}
else
{
r.push_back(bddfalse);
r.emplace_back(bddfalse);
}
}
@ -886,11 +886,11 @@ namespace spot
if (used.has(i))
{
sets[base] = i;
r.push_back(bdd_ithvar(base++));
r.emplace_back(bdd_ithvar(base++));
}
else
{
r.push_back(bddfalse);
r.emplace_back(bddfalse);
}
}
@ -950,13 +950,13 @@ namespace spot
{
sets[base] = i;
bdd v = bdd_ithvar(base++);
r.push_back(v);
r.emplace_back(v);
if (inf.has(i))
known &= v;
}
else
{
r.push_back(bddfalse);
r.emplace_back(bddfalse);
}
}
@ -984,12 +984,12 @@ namespace spot
bdd h = bdd_high(cube);
if (h == bddfalse) // Negative variable
{
partial.push_back(s);
partial.emplace_back(s);
cube = bdd_low(cube);
}
else // Positive variable
{
partial.push_back(-s - 1);
partial.emplace_back(-s - 1);
cube = h;
}
}
@ -1579,7 +1579,7 @@ namespace spot
v.reserve(num);
while (num > 0)
{
v.push_back(parse_range(input));
v.emplace_back(parse_range(input));
--num;
}
c = acc_cond::acc_code::generalized_rabin(v.begin(), v.end());

View file

@ -647,7 +647,7 @@ namespace spot
acc_word w;
w.op = acc_op::And;
w.size = size();
push_back(w);
emplace_back(w);
return *this;
}
@ -738,7 +738,7 @@ namespace spot
acc_word w;
w.op = acc_op::And;
w.size = size();
push_back(w);
emplace_back(w);
return *this;
}
@ -782,7 +782,7 @@ namespace spot
acc_word w;
w.op = acc_op::Or;
w.size = size();
push_back(w);
emplace_back(w);
return *this;
}

View file

@ -55,7 +55,7 @@ namespace spot
b = high;
}
assert(b != bddfalse);
v.push_back(res);
v.emplace_back(res);
}
return formula::And(v);
}

View file

@ -135,7 +135,7 @@ namespace spot
t->condition = bddtrue;
t->acceptance_conditions = 0U;
t->dst = new taa_tgba::state_set;
succ_.push_back(t);
succ_.emplace_back(t);
return;
}
@ -150,7 +150,7 @@ namespace spot
std::vector<iterator> pos;
pos.reserve(bounds.size());
for (auto i: bounds)
pos.push_back(i.first);
pos.emplace_back(i.first);
while (pos[0] != bounds[0].second)
{
@ -207,10 +207,10 @@ namespace spot
if (t->condition != bddfalse
&& (i == seen_.end() || j == i->second.end()))
{
seen_[b].push_back(t);
seen_[b].emplace_back(t);
if (i != seen_.end())
delete b;
succ_.push_back(t);
succ_.emplace_back(t);
}
else
{

View file

@ -178,7 +178,7 @@ namespace spot
t->dst = dst;
t->condition = bddtrue;
t->acceptance_conditions = 0U;
src->push_back(t);
src->emplace_back(t);
return t;
}
@ -186,7 +186,7 @@ namespace spot
create_transition(const label& s, const label& d)
{
std::vector<std::string> vec;
vec.push_back(d);
vec.emplace_back(d);
return create_transition(s, vec);
}
@ -266,7 +266,7 @@ namespace spot
state_set* ss = new state_set;
for (unsigned i = 0; i < names.size(); ++i)
ss->insert(add_state(names[i]));
state_set_vec_.push_back(ss);
state_set_vec_.emplace_back(ss);
return ss;
}

View file

@ -728,7 +728,7 @@ namespace spot
int res = dict_->has_registered_proposition(ap, this);
if (res < 0)
{
aps_.push_back(ap);
aps_.emplace_back(ap);
res = dict_->register_proposition(ap, this);
bddaps_ &= bdd_ithvar(res);
}
@ -768,7 +768,7 @@ namespace spot
for (unsigned n = 0; n < s; ++n)
if (m[n].refs.find(this) != m[n].refs.end())
{
aps_.push_back(m[n].f);
aps_.emplace_back(m[n].f);
bddaps_ &= bdd_ithvar(n);
}
}

View file

@ -216,7 +216,7 @@ namespace spot
if (tid == 0U)
{
todo.pop_back();
order.push_back(src);
order.emplace_back(src);
continue;
}
auto& t = g_.edge_storage(tid);