summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-08-23 11:21:32 +0400
committerAlex Turbov <i.zaufi@gmail.com>2022-11-17 16:37:09 +0400
commitc802bfc548c82e13c916b7e14fc81daa1c733213 (patch)
tree7296a4fc9f0e9f04a512eace5e96b58d19602d44
parentf27537ec3db3a53a83da9d9824f10f139397476e (diff)
downloadcmake-c802bfc548c82e13c916b7e14fc81daa1c733213.tar.gz
cmDocumentationFormatter: Eliminate one `if` in the `PrintColumn` loop
-rw-r--r--Source/cmDocumentationFormatter.cxx9
1 files changed, 2 insertions, 7 deletions
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 85276fc503..9d773e910d 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.