diff options
author | Cengizhan Pasaoglu <cengizhanpasaoglu@gmail.com> | 2018-11-06 06:47:40 (GMT) |
---|---|---|
committer | Cengizhan Pasaoglu <cengizhanpasaoglu@gmail.com> | 2018-11-06 18:43:33 (GMT) |
commit | c67ab22cdc680f6322e558b4f2c7cc74b6dbe163 (patch) | |
tree | 7197d12da074c751ad482f8dd9ed009a5f290198 /Source/cmAddSubDirectoryCommand.cxx | |
parent | bfdd1ba604a31b3bb9f0baa29ce6fce467ee2e47 (diff) | |
download | CMake-c67ab22cdc680f6322e558b4f2c7cc74b6dbe163.zip CMake-c67ab22cdc680f6322e558b4f2c7cc74b6dbe163.tar.gz CMake-c67ab22cdc680f6322e558b4f2c7cc74b6dbe163.tar.bz2 |
Using front() and back() instead of calculations
Diffstat (limited to 'Source/cmAddSubDirectoryCommand.cxx')
-rw-r--r-- | Source/cmAddSubDirectoryCommand.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 75bd6fb..75e5aa4 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -20,7 +20,7 @@ bool cmAddSubDirectoryCommand::InitialPass( } // store the binpath - std::string const& srcArg = args[0]; + std::string const& srcArg = args.front(); std::string binArg; bool excludeFromAll = false; @@ -84,10 +84,10 @@ bool cmAddSubDirectoryCommand::InitialPass( const std::string& bin = this->Makefile->GetCurrentBinaryDirectory(); size_t srcLen = src.length(); size_t binLen = bin.length(); - if (srcLen > 0 && src[srcLen - 1] == '/') { + if (srcLen > 0 && src.back() == '/') { --srcLen; } - if (binLen > 0 && bin[binLen - 1] == '/') { + if (binLen > 0 && bin.back() == '/') { --binLen; } binPath = bin.substr(0, binLen) + srcPath.substr(srcLen); |