diff options
author | Brad King <brad.king@kitware.com> | 2015-01-19 14:43:27 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-01-19 14:43:27 (GMT) |
commit | a6bbbd0f4a9ca9d683000f3302842bc25615e57a (patch) | |
tree | 208264c5b8244efcc6a8e15c39774ef46e5971ad /Source/cmakemain.cxx | |
parent | 95d42840e88599ab1959f7531668e320a7c20fdf (diff) | |
parent | fa889c4d2f49ed4b3edc8e7820b4d9bbfeeeb2a3 (diff) | |
download | CMake-a6bbbd0f4a9ca9d683000f3302842bc25615e57a.zip CMake-a6bbbd0f4a9ca9d683000f3302842bc25615e57a.tar.gz CMake-a6bbbd0f4a9ca9d683000f3302842bc25615e57a.tar.bz2 |
Merge topic 'use-member-insert'
fa889c4d cmakemain: Initialize vector content with iterators directly.
8211010c cmakemain: Use member insert in command line handling code.
b5422573 cmListCommand: Replace loop with member algorithm.
92a37f92 Convert raw loops to set member insert.
aac44e71 Convert raw loops to vector member insert.
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r-- | Source/cmakemain.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 61b175e..9e84e68 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -96,11 +96,9 @@ static const char * cmDocumentationOptions[][2] = static int do_command(int ac, char const* const* av) { std::vector<std::string> args; + args.reserve(ac - 1); args.push_back(av[0]); - for(int i = 2; i < ac; ++i) - { - args.push_back(av[i]); - } + args.insert(args.end(), av + 2, av + ac); return cmcmd::ExecuteCMakeCommand(args); } @@ -221,11 +219,7 @@ int do_cmake(int ac, char const* const* av) // the command line args are processed here so that you can do // -DCMAKE_MODULE_PATH=/some/path and have this value accessible here - std::vector<std::string> args; - for(int i =0; i < ac; ++i) - { - args.push_back(av[i]); - } + std::vector<std::string> args(av, av + ac); hcm.SetCacheArgs(args); std::vector<cmDocumentationEntry> generators; |