Commit 8026697a authored by Stefan Westerfeld's avatar Stefan Westerfeld

Change result order for same time: AB blocks should go after B block

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 5c040ae0
......@@ -178,25 +178,27 @@ public:
const int all2 = p2.type == Type::ALL;
const auto p1bits = bit_vec_to_str (p1.bit_vec);
const auto p2bits = bit_vec_to_str (p2.bit_vec);
auto ab = [] (const Pattern& pattern) {
switch (pattern.sync_score.block_type) {
case ConvBlockType::a: return 0;
case ConvBlockType::b: return 1;
case ConvBlockType::ab: return 2;
};
return 99; // should not happen
};
if (p1.key.name() != p2.key.name())
return p1.key.name() < p2.key.name();
else if (all1 != all2)
return all1 < all2;
else if (p1.time != p2.time)
return p1.time < p2.time;
else if (p1bits != p2bits)
return p1bits < p2bits;
else if (ab (p1) != ab (p2))
return ab (p1) < ab (p2);
else
{
auto ab = [] (const Pattern& pattern) {
switch (pattern.sync_score.block_type) {
case ConvBlockType::a: return 0;
case ConvBlockType::b: return 1;
case ConvBlockType::ab: return 2;
};
return 99; // should not happen
};
return ab (p1) < ab (p2);
return p1bits < p2bits;
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment