From 058fdf1dc69d23e1cfc442c855acb56cde9fe50f Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Mon, 5 Jul 2021 14:15:34 +0200 Subject: [PATCH] * spot/misc/bitset.hh (operator-=): Simplify sightly. --- spot/misc/bitset.hh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/spot/misc/bitset.hh b/spot/misc/bitset.hh index 2e42adb35..d17d26409 100644 --- a/spot/misc/bitset.hh +++ b/spot/misc/bitset.hh @@ -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; }