avoid mark_t::count() when possible

count() may be implemented using a loop, so using it touch
check count() == 1 or count() > 1 is not advisable.

* spot/twa/acc.hh (mark_t::is_singleton, mark_t::has_many): Introduce
these two methods to replace count()==1 and count()>1
* spot/twa/acc.cc, spot/twaalgos/cleanacc.cc,
spot/twaalgos/determinize.cc, spot/twaalgos/dtwasat.cc,
spot/twaalgos/iscolored.cc, spot/twaalgos/remfin.cc,
spot/twaalgos/toparity.cc: Adjust usage.
This commit is contained in:
Alexandre Duret-Lutz 2020-04-18 23:23:44 +02:00
parent c0e1b3e52a
commit cc12d514be
8 changed files with 219 additions and 197 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2015-2019 Laboratoire de Recherche et
// Copyright (C) 2015-2020 Laboratoire de Recherche et
// Développement de l'Epita.
//
// This file is part of Spot, a model checking library.
@ -195,7 +195,7 @@ namespace spot
int newb = brace;
if (acc)
{
assert(acc.has(0) && acc.count() == 1 && "Only TBA are accepted");
assert(acc.has(0) && acc.is_singleton() && "Only TBA are accepted");
// Accepting edges generate new braces: step A1
newb = braces_.size();
braces_.emplace_back(brace);