Skip to content

Commit

Permalink
less crazy if elses
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisGoosen committed Nov 28, 2024
1 parent 52eaf18 commit 0291089
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CommonData/column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2381,12 +2381,13 @@ stringvec Column::previewTransform(columnType transformType)
for(Label * label : _labels)
if(!label->isEmptyValue() && !ColumnUtils::isDoubleValue(label->originalValueAsString()))
{
if(count < showThisMany)
if(count++ < showThisMany)
someImplicitEmptyValues << (count++ > 0 ? ", " : "") << '"' << label->originalValueAsString() << '"';
else if(count++ == showThisMany)
someImplicitEmptyValues << ", ...";
else
{
someImplicitEmptyValues << ", ...";
break; // Do not need to loop further over the labels.
}
}
}

Expand Down

0 comments on commit 0291089

Please sign in to comment.