From 0ea719326ea78b423a5ec95b1218b626e9392f07 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 14 Jan 2015 22:23:41 +0100 Subject: cmFindBase: Replace loop with cmJoin on range. --- Source/cmFindBase.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx index 69991d5..6e55533 100644 --- a/Source/cmFindBase.cxx +++ b/Source/cmFindBase.cxx @@ -166,11 +166,9 @@ bool cmFindBase::ParseArguments(std::vector const& argsIn) } else { - this->VariableDocumentation += "one of the " + this->Names[0]; - for (unsigned int j = 1; j < this->Names.size() - 1; ++j) - { - this->VariableDocumentation += ", " + this->Names[j]; - } + this->VariableDocumentation += "one of the "; + this->VariableDocumentation += cmJoin(cmRange(this->Names).retreat(1), + ", "); this->VariableDocumentation += " or " + this->Names[this->Names.size() - 1] + " libraries be found"; } -- cgit v0.12