From c802bfc548c82e13c916b7e14fc81daa1c733213 Mon Sep 17 00:00:00 2001 From: Alex Turbov Date: Tue, 23 Aug 2022 11:21:32 +0400 Subject: cmDocumentationFormatter: Eliminate one `if` in the `PrintColumn` loop --- Source/cmDocumentationFormatter.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx index 85276fc..9d773e9 100644 --- a/Source/cmDocumentationFormatter.cxx +++ b/Source/cmDocumentationFormatter.cxx @@ -102,13 +102,8 @@ void cmDocumentationFormatter::PrintColumn(std::ostream& os, const char* text) if (column) { // Not first word on line. Separate from the previous word // by a space, or two if this is a new sentence. - if (newSentence) { - os << " "; - column += 2; - } else { - os << ' '; - column += 1; - } + os << &(" "[std::size_t(!newSentence)]); + column += 1u + std::ptrdiff_t(newSentence); } else if (!firstLine && this->TextIndent) { // First word on line. Print indentation unless this is the // first line. -- cgit v0.12