* spot/misc/bitset.hh (operator-=): Simplify sightly.
This commit is contained in:
parent
b01bc62f52
commit
058fdf1dc6
1 changed files with 10 additions and 14 deletions
|
|
@ -298,21 +298,17 @@ namespace spot
|
||||||
bitset& operator-=(word_t s)
|
bitset& operator-=(word_t s)
|
||||||
{
|
{
|
||||||
for (auto& v : data)
|
for (auto& v : data)
|
||||||
{
|
if (v >= s)
|
||||||
if (s == 0)
|
{
|
||||||
|
v -= s;
|
||||||
|
s = 0;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
if (v >= s)
|
else
|
||||||
{
|
{
|
||||||
v -= s;
|
v -= s;
|
||||||
s = 0;
|
s = 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
v -= s;
|
|
||||||
s = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue