abacus: bignum: use IIFE

I think it looks cleaner to use Immediately Invoked Function Expressions
in such cases.
This commit is contained in:
Bruno BELANYI 2021-10-12 15:02:33 +02:00
parent 5c7c2af289
commit da8b08e4e3

View file

@ -82,12 +82,12 @@ digits_type do_addition(digits_type const& lhs, digits_type const& rhs) {
++it2; ++it2;
} }
auto it = it1; auto [it, end] = [=]() {
auto end = end1; if (it1 != end1) {
if (it1 == end1) { return std::make_pair(it1, end1);
it = it2;
end = end2;
} }
return std::make_pair(it2, end2);
}();
while (it != end) { while (it != end) {
int addition = *it + carry; int addition = *it + carry;