From dcb0d27dd796c9e0a3c5867342cd515f562ac728 Mon Sep 17 00:00:00 2001 From: Jakob Rath Date: Thu, 17 Aug 2023 18:02:15 +0200 Subject: [PATCH] Use get_bit instead of bitwise_and --- src/util/tbv.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/util/tbv.cpp b/src/util/tbv.cpp index 017ca0eb7..5048267ad 100644 --- a/src/util/tbv.cpp +++ b/src/util/tbv.cpp @@ -142,12 +142,8 @@ void tbv_manager::set(tbv& dst, rational const& r, unsigned hi, unsigned lo) { set(dst, r.get_uint64(), hi, lo); return; } - for (unsigned i = 0; i < hi - lo + 1; ++i) { - if (bitwise_and(r, rational::power_of_two(i)).is_zero()) - set(dst, lo + i, BIT_0); - else - set(dst, lo + i, BIT_1); - } + for (unsigned i = 0; i < hi - lo + 1; ++i) + set(dst, lo + i, r.get_bit(i) ? BIT_1 : BIT_0); } void tbv_manager::set(tbv& dst, tbv const& other, unsigned hi, unsigned lo) {