From 02910890aa90235edfdcc62e6043acb3acd65702 Mon Sep 17 00:00:00 2001 From: Joris Goosen Date: Thu, 28 Nov 2024 17:38:12 +0100 Subject: [PATCH] less crazy if elses --- CommonData/column.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CommonData/column.cpp b/CommonData/column.cpp index c9d9625c4e..99f52ccfd6 100644 --- a/CommonData/column.cpp +++ b/CommonData/column.cpp @@ -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. + } } }