Commit 64882cd6 authored by Shlomi Fish's avatar Shlomi Fish

Refactoring: avoid duplicate code.

parent 773af056
......@@ -125,10 +125,8 @@ QString Freecell::solverFormat() const
tmp.truncate(0);
for (int i = 0; i < 4 ; i++) {
if (freecell[i]->isEmpty())
tmp += QLatin1String("- ");
else
tmp += cardToRankSuitString(freecell[i]->topCard()) + ' ';
const auto fc = freecell[i];
tmp += (fc->isEmpty() ? QLatin1String("-") : cardToRankSuitString(fc->topCard())) + ' ';
}
if (!tmp.isEmpty())
{
......
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