diff options
author | Artur Ryt <artur.ryt@gmail.com> | 2019-02-04 21:56:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-06 15:43:16 (GMT) |
commit | f3534386b504430aec926e46a413b044ff64d769 (patch) | |
tree | cb29c859cee6cdc69c0d8b25d719b4096be53ff8 /Source/cmSearchPath.cxx | |
parent | 062cfd991faac000d484c74e5af7d65726c655dc (diff) | |
download | CMake-f3534386b504430aec926e46a413b044ff64d769.zip CMake-f3534386b504430aec926e46a413b044ff64d769.tar.gz CMake-f3534386b504430aec926e46a413b044ff64d769.tar.bz2 |
Prefer front/back/data over dereferencing begin/rbegin iter
Changed for sequenced containers: vector, list, string and array
Diffstat (limited to 'Source/cmSearchPath.cxx')
-rw-r--r-- | Source/cmSearchPath.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index 0f51e0e..f98984e 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -144,7 +144,7 @@ void cmSearchPath::AddSuffixes(const std::vector<std::string>& suffixes) // this will get incorrectly considered a network // path on windows and cause huge delays. std::string p = inPath; - if (!p.empty() && *p.rbegin() != '/') { + if (!p.empty() && p.back() != '/') { p += "/"; } @@ -176,7 +176,7 @@ void cmSearchPath::AddPrefixPaths(const std::vector<std::string>& paths, for (std::string const& path : paths) { std::string dir = path; - if (!subdir.empty() && !dir.empty() && *dir.rbegin() != '/') { + if (!subdir.empty() && !dir.empty() && dir.back() != '/') { dir += "/"; } if (subdir == "include" || subdir == "lib") { |