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
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue