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/cmExtraEclipseCDT4Generator.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/cmExtraEclipseCDT4Generator.cxx')
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 34f58ad..87ee382 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -976,9 +976,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const lg->GetIndividualFileTargets(objectFileTargets); for (std::string const& f : objectFileTargets) { const char* prefix = "[obj] "; - if (f[f.length() - 1] == 's') { + if (f.back() == 's') { prefix = "[to asm] "; - } else if (f[f.length() - 1] == 'i') { + } else if (f.back() == 'i') { prefix = "[pre] "; } this->AppendTarget(xml, f, make, makeArgs, subdir, prefix); @@ -1035,8 +1035,7 @@ std::string cmExtraEclipseCDT4Generator::GetPathBasename( { std::string outputBasename = path; while (!outputBasename.empty() && - (outputBasename[outputBasename.size() - 1] == '/' || - outputBasename[outputBasename.size() - 1] == '\\')) { + (outputBasename.back() == '/' || outputBasename.back() == '\\')) { outputBasename.resize(outputBasename.size() - 1); } std::string::size_type loc = outputBasename.find_last_of("/\\"); |