summaryrefslogtreecommitdiff
path: root/Source/cmOutputRequiredFilesCommand.cxx
diff options
context:
space:
mode:
authorCengizhan Pasaoglu <cengizhanpasaoglu@gmail.com>2018-11-06 09:47:40 +0300
committerCengizhan Pasaoglu <cengizhanpasaoglu@gmail.com>2018-11-06 21:43:33 +0300
commitc67ab22cdc680f6322e558b4f2c7cc74b6dbe163 (patch)
tree7197d12da074c751ad482f8dd9ed009a5f290198 /Source/cmOutputRequiredFilesCommand.cxx
parentbfdd1ba604a31b3bb9f0baa29ce6fce467ee2e47 (diff)
downloadcmake-c67ab22cdc680f6322e558b4f2c7cc74b6dbe163.tar.gz
Using front() and back() instead of calculations
Diffstat (limited to 'Source/cmOutputRequiredFilesCommand.cxx')
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index e2de3f98ea..87c1ec055e 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -340,7 +340,7 @@ protected:
} else {
// try to guess which include path to use
for (std::string incpath : this->IncludeDirectories) {
- if (!incpath.empty() && incpath[incpath.size() - 1] != '/') {
+ if (!incpath.empty() && incpath.back() != '/') {
incpath = incpath + "/";
}
incpath = incpath + path;
@@ -421,7 +421,7 @@ protected:
}
for (std::string path : this->IncludeDirectories) {
- if (!path.empty() && path[path.size() - 1] != '/') {
+ if (!path.empty() && path.back() != '/') {
path = path + "/";
}
path = path + fname;
@@ -435,7 +435,7 @@ protected:
if (extraPath) {
std::string path = extraPath;
- if (!path.empty() && path[path.size() - 1] != '/') {
+ if (!path.empty() && path.back() != '/') {
path = path + "/";
}
path = path + fname;