* src/sanity/style.test: Warn about places where size() is used
instead of empty(). * src/misc/bddalloc.cc (bdd_allocator::extend): Use empty() rather than size() when checking emptiness of lists. * src/tgbaalgos/reductgba_sim_del.cc, src/tgbaalgos/minimalce.cc, src/ltlvisit/basicreduce.cc, src/ltlvisit/reduce.cc, src/tgbaalgos/gtec/ce.cc, src/tgbaalgos/ltl2tgba_fm.cc, src/misc/minato.cc: Likewise. * src/ltlast/multop.cc (multop::instance): Call ->size() only once.
This commit is contained in:
parent
f0aa58034c
commit
c30823f7be
11 changed files with 57 additions and 39 deletions
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
//
|
||||
|
|
@ -152,7 +152,8 @@ namespace spot
|
|||
}
|
||||
}
|
||||
|
||||
if (v->size() == 0)
|
||||
vec::size_type s = v->size();
|
||||
if (s == 0)
|
||||
{
|
||||
delete v;
|
||||
switch (op)
|
||||
|
|
@ -165,7 +166,7 @@ namespace spot
|
|||
/* Unreachable code. */
|
||||
assert(0);
|
||||
}
|
||||
if (v->size() == 1)
|
||||
else if (s == 1)
|
||||
{
|
||||
formula* res = (*v)[0];
|
||||
delete v;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue