From ebc94500c1726f393ac6119848d53deca47e1ccf Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Mon, 4 Mar 2019 10:27:15 +0100 Subject: cmGlobalGenerator: Optimize Printable() method from GeneratedMakeCommand --- Source/cmGlobalGenerator.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index d69c311..1eda572 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -69,20 +69,7 @@ struct GeneratedMakeCommand PrimaryCommand.insert(PrimaryCommand.end(), start, end); } - std::string Printable() const - { - std::size_t size = PrimaryCommand.size(); - for (auto&& i : PrimaryCommand) { - size += i.size(); - } - std::string buffer; - buffer.reserve(size); - for (auto&& i : PrimaryCommand) { - buffer.append(i); - buffer.append(1, ' '); - } - return buffer; - } + std::string Printable() const { return cmJoin(PrimaryCommand, " "); } std::vector PrimaryCommand; bool RequiresOutputForward = false; -- cgit v0.12