Update mutator.cpp

Don't check variable res twice.
This commit is contained in:
Max Vetrov 2018-06-24 23:48:16 +02:00 committed by alexey-milovidov
parent ea59cb0b05
commit 6e273978c5

View File

@ -106,9 +106,11 @@ static void mutate(pcg64 & generator, void * src, size_t length)
&& isAlphaASCII(pos[2]))
{
auto res = rand(generator, 0, 3);
if (res == 2)
if (res == 2)
{
std::swap(pos[0], pos[1]);
if (res == 3)
}
else if (res == 3)
std::swap(pos[1], pos[2]);
pos += 3;
@ -124,7 +126,7 @@ static void mutate(pcg64 & generator, void * src, size_t length)
std::swap(pos[1], pos[2]);
std::swap(pos[0], pos[1]);
}
if (res == 3)
else if (res == 3)
{
std::swap(pos[3], pos[2]);
std::swap(pos[4], pos[3]);