Use emplace() for associative containers.
* HACKING: Adjust requirements. g++4.8 is now OK for all our targets. * iface/dve2/dve2.cc, src/dstarparse/dstarparse.yy src/dstarparse/nsa2tgba.cc, src/graph/ngraph.hh, src/ltlast/atomic_prop.cc, src/ltlast/binop.cc, src/ltlast/bunop.cc, src/ltlast/multop.cc, src/ltlast/unop.cc, src/ltlvisit/mark.cc, src/ltlvisit/relabel.cc, src/taalgos/emptinessta.cc, src/taalgos/tgba2ta.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbagraph.hh, src/tgba/tgbasafracomplement.cc, src/tgba/tgbatba.cc, src/tgbaalgos/cycles.cc, src/tgbaalgos/degen.cc, src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/emptiness.cc, src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc, src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/reachiter.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/se05.cc, src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc, src/tgbaalgos/weight.cc: Use emplace() instead of insert(make_pair(...)) or insert(...::value_type(...)).
This commit is contained in:
parent
1eaaf8832a
commit
fd5fbda4dd
35 changed files with 77 additions and 104 deletions
23
HACKING
23
HACKING
|
|
@ -229,25 +229,12 @@ C++11
|
|||
-----
|
||||
|
||||
Spot uses some C++11 features, and therefore requires a C++11
|
||||
compiler. However (1) fully C++11-compliant compilers are
|
||||
not yet well deployed, and (2) development tools have yet
|
||||
to be updated to provide suitable C++11 support. For instance
|
||||
Swig 2.0, which we use for the Python bindings, does not
|
||||
understand C++11. The upcoming release of Swig 3 has better
|
||||
support for C++11, we should switch to it as soon as possible.
|
||||
compiler. The code relies on features that are not available in
|
||||
version of g++ older than 4.8, so this is our minimum requirement
|
||||
for now. Avoid features that require 4.9.
|
||||
|
||||
In the meantime, try to keep the C++11-specific syntax in the *.cc
|
||||
files as much as possible.
|
||||
|
||||
Use only C++11 features that are available in clang 3.1 and g++ 4.6:
|
||||
- http://gcc.gnu.org/projects/cxx0x.html
|
||||
- http://clang.llvm.org/cxx_status.html
|
||||
|
||||
Library interfaces that should not be used:
|
||||
- emplace() is not implemented for associative containers
|
||||
(std::map, std::set, and their unordered ffriends) is
|
||||
before g++ 4.8. Use
|
||||
x.insert(std::make_pair(...)) instead of x.emplace(...)
|
||||
Reasonably recent versions of clang should work as well. Our
|
||||
build farm has clang++ 3.5.
|
||||
|
||||
Encoding
|
||||
--------
|
||||
|
|
|
|||
|
|
@ -353,9 +353,7 @@ namespace spot
|
|||
{
|
||||
int enum_count = d->get_state_variable_type_value_count(i);
|
||||
for (int j = 0; j < enum_count; ++j)
|
||||
enum_map[i]
|
||||
.insert(std::make_pair(d->get_state_variable_type_value(i, j),
|
||||
j));
|
||||
enum_map[i].emplace(d->get_state_variable_type_value(i, j), j);
|
||||
}
|
||||
|
||||
for (ltl::atomic_prop_set::const_iterator ap = aps->begin();
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ transitions:
|
|||
| transitions NUMBER opt_eols
|
||||
{
|
||||
std::pair<map_t::iterator, bool> i =
|
||||
result.dest_map.insert(std::make_pair($2, *result.cur_guard));
|
||||
result.dest_map.emplace($2, *result.cur_guard);
|
||||
if (!i.second)
|
||||
i.first->second |= *result.cur_guard;
|
||||
++result.cur_guard;
|
||||
|
|
|
|||
|
|
@ -175,8 +175,7 @@ namespace spot
|
|||
build_state d(dlabel, pend);
|
||||
// Have we already seen this destination?
|
||||
int dest;
|
||||
std::pair<bs2num_map::iterator, bool> dres =
|
||||
bs2num.insert(bs2num_map::value_type(d, 0));
|
||||
auto dres = bs2num.emplace(d, 0);
|
||||
if (!dres.second)
|
||||
{
|
||||
dest = dres.first->second;
|
||||
|
|
@ -199,8 +198,7 @@ namespace spot
|
|||
build_state d(label(a, i->current_state()), pend);
|
||||
// Have we already seen this destination?
|
||||
int dest;
|
||||
std::pair<bs2num_map::iterator, bool> dres =
|
||||
bs2num.insert(bs2num_map::value_type(d, 0));
|
||||
auto dres = bs2num.emplace(d, 0);
|
||||
if (!dres.second)
|
||||
{
|
||||
dest = dres.first->second;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace spot
|
|||
template <typename... Args>
|
||||
state new_state(name n, Args&&... args)
|
||||
{
|
||||
auto p = name_to_state.insert(std::make_pair(n, 0U));
|
||||
auto p = name_to_state.emplace(n, 0U);
|
||||
if (p.second)
|
||||
{
|
||||
unsigned s = g_.new_state(std::forward<Args>(args)...);
|
||||
|
|
@ -81,7 +81,7 @@ namespace spot
|
|||
/// \return true iff the newname was already used.
|
||||
bool alias_state(state s, name newname)
|
||||
{
|
||||
return !name_to_state.insert(std::make_pair(newname, s)).second;
|
||||
return !name_to_state.emplace(newname, s).second;
|
||||
}
|
||||
|
||||
state get_state(name n) const
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace spot
|
|||
atomic_prop::instance(const std::string& name, environment& env)
|
||||
{
|
||||
const atomic_prop* ap;
|
||||
auto ires = instances.insert(std::make_pair(key(name, &env), nullptr));
|
||||
auto ires = instances.emplace(key(name, &env), nullptr);
|
||||
if (!ires.second)
|
||||
ap = ires.first->second;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -504,8 +504,7 @@ namespace spot
|
|||
}
|
||||
|
||||
const binop* res;
|
||||
auto ires = instances.insert(std::make_pair(key(op, first, second),
|
||||
nullptr));
|
||||
auto ires = instances.emplace(key(op, first, second), nullptr);
|
||||
if (!ires.second)
|
||||
{
|
||||
// This instance already exists.
|
||||
|
|
|
|||
|
|
@ -237,8 +237,7 @@ namespace spot
|
|||
}
|
||||
|
||||
const formula* res;
|
||||
auto ires = instances.insert(std::make_pair(key(op, child, min, max),
|
||||
nullptr));
|
||||
auto ires = instances.emplace(key(op, child, min, max), nullptr);
|
||||
if (!ires.second)
|
||||
{
|
||||
// This instance already exists.
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ namespace spot
|
|||
const multop* res;
|
||||
// Insert the key with the dummy nullptr just
|
||||
// to check if p already exists.
|
||||
auto ires = instances.insert(std::make_pair(key(op, v), nullptr));
|
||||
auto ires = instances.emplace(key(op, v), nullptr);
|
||||
if (!ires.second)
|
||||
{
|
||||
// The instance did already exists. Free v.
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ namespace spot
|
|||
}
|
||||
|
||||
const unop* res;
|
||||
auto ires = instances.insert(std::make_pair(key(op, child), nullptr));
|
||||
auto ires = instances.emplace(key(op, child), nullptr);
|
||||
if (!ires.second)
|
||||
{
|
||||
// This instance already exists.
|
||||
|
|
|
|||
|
|
@ -114,8 +114,7 @@ namespace spot
|
|||
switch (bo->op())
|
||||
{
|
||||
case binop::EConcatMarked:
|
||||
empairs.insert(std::make_pair(bo->first(),
|
||||
bo->second()));
|
||||
empairs.emplace(bo->first(), bo->second());
|
||||
// fall through
|
||||
case binop::Xor:
|
||||
case binop::Implies:
|
||||
|
|
|
|||
|
|
@ -110,8 +110,7 @@ namespace spot
|
|||
|
||||
const formula* rename(const formula* old)
|
||||
{
|
||||
std::pair<map::iterator, bool> r =
|
||||
newname.insert(map::value_type(old, 0));
|
||||
auto r = newname.emplace(old, nullptr);
|
||||
if (!r.second)
|
||||
{
|
||||
return r.first->second->clone();
|
||||
|
|
@ -327,9 +326,7 @@ namespace spot
|
|||
void
|
||||
recurse(const formula* f)
|
||||
{
|
||||
std::pair<fgraph::iterator, bool> i =
|
||||
g.insert(fgraph::value_type(f, succ_vec()));
|
||||
|
||||
auto i = g.emplace(f, succ_vec());
|
||||
if (!s.empty())
|
||||
{
|
||||
const formula* top = s.top();
|
||||
|
|
@ -356,6 +353,10 @@ namespace spot
|
|||
{
|
||||
unsigned num; // serial number, in pre-order
|
||||
unsigned low; // lowest number accessible via unstacked descendants
|
||||
data_entry(unsigned num = 0, unsigned low = 0)
|
||||
: num(num), low(low)
|
||||
{
|
||||
}
|
||||
};
|
||||
typedef std::unordered_map<const formula*, data_entry,
|
||||
const formula_ptr_hash> fmap_t;
|
||||
|
|
@ -410,9 +411,9 @@ namespace spot
|
|||
// std::cerr << " grand parent is "
|
||||
// << to_string(e.grand_parent)
|
||||
// << "\n child is " << to_string(child) << '\n';
|
||||
data_entry d = { num, num };
|
||||
std::pair<fmap_t::iterator, bool> i =
|
||||
data.insert(fmap_t::value_type(child, d));
|
||||
auto i = data.emplace(std::piecewise_construct,
|
||||
std::forward_as_tuple(child),
|
||||
std::forward_as_tuple(num, num));
|
||||
if (i.second) // New destination.
|
||||
{
|
||||
++num;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ namespace spot
|
|||
state_ta_product* init = new state_ta_product(
|
||||
(ta_init_it_->current_state()), kripke_init_state->clone());
|
||||
|
||||
if (!h.insert(std::make_pair(init, num + 1)).second)
|
||||
if (!h.emplace(init, num + 1).second)
|
||||
{
|
||||
init->destroy();
|
||||
continue;
|
||||
|
|
@ -216,7 +216,7 @@ namespace spot
|
|||
// We do not need SUCC from now on.
|
||||
|
||||
// Are we going to a new state?
|
||||
auto p = h.insert(std::make_pair(dest, num + 1));
|
||||
auto p = h.emplace(dest, num + 1);
|
||||
if (p.second)
|
||||
{
|
||||
// Number it, stack it, and register its successors
|
||||
|
|
@ -427,7 +427,7 @@ namespace spot
|
|||
state* init = ta_init_it_.front();
|
||||
ta_init_it_.pop();
|
||||
|
||||
if (!h.insert(std::make_pair(init, num + 1)).second)
|
||||
if (!h.emplace(init, num + 1).second)
|
||||
{
|
||||
init->destroy();
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ namespace spot
|
|||
down_cast<state_ta_explicit*> (init_set.top());
|
||||
init_set.pop();
|
||||
|
||||
if (!h.insert(std::make_pair(init, num + 1)).second)
|
||||
if (!h.emplace(init, num + 1).second)
|
||||
{
|
||||
init->destroy();
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ namespace spot
|
|||
last_dest = dest;
|
||||
dmi = dm.find(dest);
|
||||
if (dmi == dm.end())
|
||||
dmi = dm.insert(std::make_pair(dest, acc_map())).first;
|
||||
dmi = dm.emplace(dest, acc_map()).first;
|
||||
}
|
||||
int acc = t1->acceptance_conditions.id();
|
||||
typename acc_map::iterator it = dmi->second.find(acc);
|
||||
|
|
@ -460,8 +460,7 @@ namespace spot
|
|||
if (j != alias_.end())
|
||||
return j->second;
|
||||
|
||||
State* res =
|
||||
&(ls_.insert(std::make_pair(name, State(name))).first->second);
|
||||
State* res = &(ls_.emplace(name, State(name)).first->second);
|
||||
sl_[res] = name;
|
||||
// The first state we add is the initial state.
|
||||
// It can also be overridden with set_init_state().
|
||||
|
|
|
|||
|
|
@ -386,7 +386,7 @@ namespace spot
|
|||
}
|
||||
|
||||
key_t k(t->dst, t->acc.id());
|
||||
auto p = trmap.insert(make_pair(k, t.trans()));
|
||||
auto p = trmap.emplace(k, t.trans());
|
||||
if (!p.second)
|
||||
{
|
||||
// A previous transitions exist for k, merge the
|
||||
|
|
|
|||
|
|
@ -1184,8 +1184,8 @@ namespace spot
|
|||
p.second, false);
|
||||
state_complement* s2 = new state_complement(e->clone(), e->clone(),
|
||||
p.second, true);
|
||||
succ_list.insert(std::make_pair(p.first, s1));
|
||||
succ_list.insert(std::make_pair(p.first, s2));
|
||||
succ_list.emplace(p.first, s1);
|
||||
succ_list.emplace(p.first, s2);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1210,7 +1210,7 @@ namespace spot
|
|||
{
|
||||
st = new state_complement(e->clone(), e->clone(),
|
||||
p.second, true);
|
||||
succ_list.insert(std::make_pair(p.first, st));
|
||||
succ_list.emplace(p.first, st);
|
||||
}
|
||||
condition = the_acceptance_cond_;
|
||||
}
|
||||
|
|
@ -1219,7 +1219,7 @@ namespace spot
|
|||
for (auto& p: tr->second)
|
||||
{
|
||||
st = new state_complement(newI, newJ, p.second, true);
|
||||
succ_list.insert(std::make_pair(p.first, st));
|
||||
succ_list.emplace(p.first, st);
|
||||
}
|
||||
}
|
||||
delete newI;
|
||||
|
|
@ -1234,7 +1234,7 @@ namespace spot
|
|||
{
|
||||
st = new state_complement(pending->clone(), e->clone(),
|
||||
p.second, true);
|
||||
succ_list.insert(std::make_pair(p.first, st));
|
||||
succ_list.emplace(p.first, st);
|
||||
}
|
||||
delete pending;
|
||||
|
||||
|
|
|
|||
|
|
@ -315,8 +315,8 @@ namespace spot
|
|||
transmap_t::iterator id = transmap_.find(key);
|
||||
if (id == transmap_.end()) // No
|
||||
{
|
||||
mapit_t pos = transmap_
|
||||
.insert(std::make_pair(key, it->current_condition())).first;
|
||||
mapit_t pos =
|
||||
transmap_.emplace(key, it->current_condition()).first;
|
||||
// Keep the order of the transitions in the
|
||||
// degeneralized automaton related to the order of the
|
||||
// transitions in the input automaton: in the past we
|
||||
|
|
|
|||
|
|
@ -66,8 +66,7 @@ namespace spot
|
|||
enumerate_cycles::tagged_state
|
||||
enumerate_cycles::tag_state(const state* s)
|
||||
{
|
||||
std::pair<tagged_state, bool> p =
|
||||
tags_.insert(std::make_pair(s, state_info()));
|
||||
auto p = tags_.emplace(s, state_info());
|
||||
if (!p.second)
|
||||
s->destroy();
|
||||
return p.first;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ namespace spot
|
|||
union_ |= set;
|
||||
}
|
||||
cache_entry e(common, union_);
|
||||
return cache_.insert(std::make_pair(s, e)).first;
|
||||
return cache_.emplace(s, e).first;
|
||||
}
|
||||
|
||||
// Intersection of all outgoing acceptance sets
|
||||
|
|
@ -144,8 +144,7 @@ namespace spot
|
|||
|
||||
bool check(const state* s)
|
||||
{
|
||||
std::pair<cache_t::iterator, bool> p =
|
||||
cache_.insert(std::make_pair(s, false));
|
||||
auto p = cache_.emplace(s, false);
|
||||
if (p.second)
|
||||
{
|
||||
bdd all = a_->all_acceptance_conditions();
|
||||
|
|
@ -569,9 +568,7 @@ namespace spot
|
|||
|
||||
if (use_lvl_cache)
|
||||
{
|
||||
std::pair<lvl_cache_t::iterator, bool> res =
|
||||
lvl_cache.insert(lvl_cache_t::value_type(d.first,
|
||||
d.second));
|
||||
auto res = lvl_cache.emplace(d.first, d.second);
|
||||
|
||||
if (!res.second)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -312,10 +312,10 @@ namespace spot
|
|||
|
||||
transition t(i, one, j);
|
||||
d.transid[t] = ++d.nvars;
|
||||
d.revtransid.insert(dict::rev_map::value_type(d.nvars, t));
|
||||
d.revtransid.emplace(d.nvars, t);
|
||||
int ta = d.transacc[t] =
|
||||
state_based_ ? transacc : ++d.nvars;
|
||||
d.revtransacc.insert(dict::rev_map::value_type(ta, t));
|
||||
d.revtransacc.emplace(ta, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -411,8 +411,7 @@ namespace spot
|
|||
|
||||
transition t(i, one, j);
|
||||
d.transid[t] = ++d.nvars;
|
||||
d.revtransid.insert(dict::rev_map::
|
||||
value_type(d.nvars, t));
|
||||
d.revtransid.emplace(d.nvars, t);
|
||||
|
||||
// Create the variable for the accepting transition
|
||||
// immediately afterwards. It helps parsing the
|
||||
|
|
@ -421,8 +420,7 @@ namespace spot
|
|||
{
|
||||
transition_acc ta(i, one, d.cand_acc[n], j);
|
||||
d.transaccid[ta] = ++d.nvars;
|
||||
d.revtransaccid.insert(dict::rev_acc_map::
|
||||
value_type(d.nvars, ta));
|
||||
d.revtransaccid.emplace(d.nvars, ta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -443,8 +441,7 @@ namespace spot
|
|||
|
||||
transition_acc ta(i, one, d.cand_acc[n], j);
|
||||
d.transaccid[ta] = d.nvars;
|
||||
d.revtransaccid.insert(dict::rev_acc_map::
|
||||
value_type(d.nvars, ta));
|
||||
d.revtransaccid.emplace(d.nvars, ta);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -459,8 +456,7 @@ namespace spot
|
|||
|
||||
transition t(i, one, j);
|
||||
d.transid[t] = ++d.nvars;
|
||||
d.revtransid.insert(dict::rev_map::
|
||||
value_type(d.nvars, t));
|
||||
d.revtransid.emplace(d.nvars, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ namespace spot
|
|||
|
||||
assert(s->compare(i->s) == 0);
|
||||
src = res->new_state();
|
||||
seen.insert(std::make_pair(i->s, src));
|
||||
seen.emplace(i->s, src);
|
||||
|
||||
for (; i != l->end();)
|
||||
{
|
||||
|
|
@ -355,7 +355,7 @@ namespace spot
|
|||
s = the_next;
|
||||
|
||||
|
||||
auto p = seen.insert(std::make_pair(next, 0));
|
||||
auto p = seen.emplace(next, 0);
|
||||
if (p.second)
|
||||
p.first->second = res->new_state();
|
||||
dst = p.first->second;
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace spot
|
|||
// We do not need SUCC from now on.
|
||||
|
||||
// Are we going to a new state?
|
||||
auto p = ecs_->h.insert(std::make_pair(dest, num + 1));
|
||||
auto p = ecs_->h.emplace(dest, num + 1);
|
||||
if (p.second)
|
||||
{
|
||||
// Yes. Bump number, stack the stack, and register its
|
||||
|
|
|
|||
|
|
@ -1749,7 +1749,7 @@ namespace spot
|
|||
}
|
||||
|
||||
f->clone();
|
||||
return ltl_bdd_.insert(std::make_pair(ff, t)).first->second;
|
||||
return ltl_bdd_.emplace(ff, t).first->second;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1974,7 +1974,7 @@ namespace spot
|
|||
if (b2f_.find(t.symbolic) == b2f_.end())
|
||||
b2f_[t.symbolic] = f;
|
||||
|
||||
return f2b_.insert(std::make_pair(f->clone(), t)).first->second;
|
||||
return f2b_.emplace(f->clone(), t).first->second;
|
||||
}
|
||||
|
||||
const formula*
|
||||
|
|
|
|||
|
|
@ -484,7 +484,7 @@ namespace spot
|
|||
void add_new_state(const state* s, color c)
|
||||
{
|
||||
assert(h.find(s) == h.end());
|
||||
h.insert(std::make_pair(s, c));
|
||||
h.emplace(s, c);
|
||||
}
|
||||
|
||||
void pop_notify(const state*) const
|
||||
|
|
|
|||
|
|
@ -557,7 +557,7 @@ namespace spot
|
|||
{
|
||||
ndfsr_trace << a_->format_state(i->source) << " (-> "
|
||||
<< a_->format_state(i->dest) << ") ";
|
||||
target.insert(std::make_pair(i->source, *i));
|
||||
target.emplace(i->source, *i);
|
||||
}
|
||||
}
|
||||
ndfsr_trace << std::endl;
|
||||
|
|
@ -605,7 +605,7 @@ namespace spot
|
|||
<< a_->format_state(begin) << std::endl;
|
||||
transition tmp;
|
||||
tmp.source = tmp.dest = 0; // Initialize to please GCC 4.0.1 (Darwin).
|
||||
target.insert(std::make_pair(begin, tmp));
|
||||
target.emplace(begin, tmp);
|
||||
min_path<true> s(this, a_, target, h_);
|
||||
const state* res = s.search(current.dest->clone(), run->cycle);
|
||||
assert(res);
|
||||
|
|
@ -623,7 +623,7 @@ namespace spot
|
|||
// Register all states from the cycle as target of the BFS.
|
||||
for (tgba_run::steps::const_iterator i = run->cycle.begin();
|
||||
i != run->cycle.end(); ++i)
|
||||
target.insert(std::make_pair(i->s, tmp));
|
||||
target.emplace(i->s, tmp);
|
||||
|
||||
const state* prefix_start = a_->get_init_state();
|
||||
// There are two cases: either the initial state is already on
|
||||
|
|
|
|||
|
|
@ -203,8 +203,7 @@ namespace spot
|
|||
}
|
||||
|
||||
dst = si->current_state();
|
||||
std::pair<seen_map::iterator, bool> res =
|
||||
seen.insert(std::make_pair(dst, n));
|
||||
auto res = seen.emplace(dst, n);
|
||||
if (!res.second)
|
||||
{
|
||||
// The state has already been seen.
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ namespace spot
|
|||
self_loops_ = 0;
|
||||
state* init = aut_->get_init_state();
|
||||
num_ = -1;
|
||||
h_.insert(std::make_pair(init, num_));
|
||||
h_.emplace(init, num_);
|
||||
root_.emplace_front(num_);
|
||||
arc_acc_.push(bddfalse);
|
||||
arc_cond_.push(bddfalse);
|
||||
|
|
@ -196,7 +196,7 @@ namespace spot
|
|||
// Record the transition between the SCC being popped
|
||||
// and the previous SCC.
|
||||
if (!root_.empty())
|
||||
root_.front().succ.insert(std::make_pair(num, cond));
|
||||
root_.front().succ.emplace(num, cond);
|
||||
}
|
||||
|
||||
aut_->release_iter(succ);
|
||||
|
|
@ -223,7 +223,7 @@ namespace spot
|
|||
{
|
||||
// Yes. Number it, stack it, and register its successors
|
||||
// for later processing.
|
||||
h_.insert(std::make_pair(dest, --num_));
|
||||
h_.emplace(dest, --num_);
|
||||
root_.emplace_front(num_);
|
||||
arc_acc_.push(acc);
|
||||
arc_cond_.push(cond);
|
||||
|
|
@ -244,7 +244,7 @@ namespace spot
|
|||
// dest SCC labelled with cond.
|
||||
succ_type::iterator i = root_.front().succ.find(dest);
|
||||
if (i == root_.front().succ.end())
|
||||
root_.front().succ.insert(std::make_pair(dest, cond));
|
||||
root_.front().succ.emplace(dest, cond);
|
||||
else
|
||||
i->second |= cond;
|
||||
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ namespace spot
|
|||
// turn makes sure we preserve the acceptance condition
|
||||
// ordering (which matters for degeneralization).
|
||||
for (BDD c = useful.id(); c != 1; c = bdd_low(c))
|
||||
remap_table[n].insert(std::make_pair(bdd_var(c), --num));
|
||||
remap_table[n].emplace(bdd_var(c), --num);
|
||||
|
||||
max_table[n] = max_num;
|
||||
}
|
||||
|
|
@ -854,7 +854,7 @@ namespace spot
|
|||
// turn makes sure we preserve the acceptance condition
|
||||
// ordering (which matters for degeneralization).
|
||||
for (BDD c = useful.id(); c != 1; c = bdd_low(c))
|
||||
remap_table[n].insert(std::make_pair(bdd_var(c), --num));
|
||||
remap_table[n].emplace(bdd_var(c), --num);
|
||||
|
||||
max_table[n] = max_num;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ namespace spot
|
|||
int i = phc->erase(ps);
|
||||
assert(i == 1);
|
||||
(void)i;
|
||||
ph->insert(std::make_pair(ps, c));
|
||||
ph->emplace(ps, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -540,7 +540,7 @@ namespace spot
|
|||
if (c == CYAN)
|
||||
hc.insert(s);
|
||||
else
|
||||
h.insert(std::make_pair(s, c));
|
||||
h.emplace(s, c);
|
||||
}
|
||||
|
||||
void pop_notify(const state*) const
|
||||
|
|
|
|||
|
|
@ -141,9 +141,9 @@ namespace spot
|
|||
map_constraint& feed_me)
|
||||
{
|
||||
for (auto& p: list)
|
||||
feed_me.insert(std::make_pair(std::make_pair(std::get<0>(p),
|
||||
std::get<1>(p)),
|
||||
std::get<2>(p)));
|
||||
feed_me.emplace(std::make_pair(std::get<0>(p),
|
||||
std::get<1>(p)),
|
||||
std::get<2>(p));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ namespace spot
|
|||
void add_new_state(const state* s, color c)
|
||||
{
|
||||
assert(h.find(s) == h.end());
|
||||
h.insert(std::make_pair(s, std::make_pair(c, bddfalse)));
|
||||
h.emplace(s, std::make_pair(c, bddfalse));
|
||||
}
|
||||
|
||||
void pop_notify(const state*) const
|
||||
|
|
|
|||
|
|
@ -445,7 +445,7 @@ namespace spot
|
|||
{
|
||||
assert(c != CYAN);
|
||||
std::pair<hash_type::iterator, bool> p;
|
||||
p = ph->insert(std::make_pair(ps, std::make_pair(c, *acc)));
|
||||
p = ph->emplace(ps, std::make_pair(c, *acc));
|
||||
assert(p.second);
|
||||
acc = &(p.first->second.second);
|
||||
int i = phc->erase(ps);
|
||||
|
|
@ -536,7 +536,9 @@ namespace spot
|
|||
assert(hc.find(s) == hc.end() && h.find(s) == h.end());
|
||||
assert(c == CYAN);
|
||||
(void)c;
|
||||
hc.insert(std::make_pair(s, std::make_pair(w, bddfalse)));
|
||||
hc.emplace(std::piecewise_construct,
|
||||
std::forward_as_tuple(s),
|
||||
std::forward_as_tuple(w, bddfalse));
|
||||
}
|
||||
|
||||
void pop_notify(const state*) const
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace spot
|
|||
{
|
||||
weight::weight_vector::iterator it = pm->find(v);
|
||||
if (it == pm->end())
|
||||
pm->insert(std::make_pair(v, 1));
|
||||
pm->emplace(v, 1);
|
||||
else
|
||||
++(it->second);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue