* spot/misc/bitset.hh (operator-=): Simplify sightly.

This commit is contained in:
Alexandre Duret-Lutz 2021-07-05 14:15:34 +02:00
parent b01bc62f52
commit 058fdf1dc6

View file

@ -298,21 +298,17 @@ namespace spot
bitset& operator-=(word_t s)
{
for (auto& v : data)
{
if (s == 0)
if (v >= s)
{
v -= s;
s = 0;
break;
if (v >= s)
{
v -= s;
s = 0;
}
else
{
v -= s;
s = 1;
}
}
}
else
{
v -= s;
s = 1;
}
return *this;
}