yul-phaser: A few more tweaks to ensure that signedness conversions do not cause warnings

- Don't cast booleans to int when the result gets assigned to an unsigned type. Relace them with ifs.
- Use unsigned initializer for a variable declared in a lambda capture.
- Unsigned abs() of a difference of unsigned values.
This commit is contained in:
Djordje Mijovic
2020-06-04 17:18:07 +02:00
committed by Kamil Śliwak
parent a49a127627
commit 9b3d1c11ff
3 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ BOOST_FIXTURE_TEST_CASE(makeRandom_should_get_chromosome_lengths_from_specified_
size_t maxLength = 5;
assert(chromosomeCount % maxLength == 0);
auto nextLength = [counter = 0, maxLength]() mutable { return counter++ % maxLength; };
auto nextLength = [counter = 0ul, maxLength]() mutable { return counter++ % maxLength; };
auto population = Population::makeRandom(m_fitnessMetric, chromosomeCount, nextLength);
// We can't rely on the order since the population sorts its chromosomes immediately but