summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-07-28 14:07:39 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-07-28 15:47:26 (GMT)
commit09977c181641dd4feea8fc13bf718f0f9cfe05bb (patch)
tree01368bfc03a8c5bd0817d0a0d6485526a394b65e /Source/cmSystemTools.cxx
parent2f19e53705a6e60af37964c146a742d845f84870 (diff)
downloadCMake-09977c181641dd4feea8fc13bf718f0f9cfe05bb.zip
CMake-09977c181641dd4feea8fc13bf718f0f9cfe05bb.tar.gz
CMake-09977c181641dd4feea8fc13bf718f0f9cfe05bb.tar.bz2
cmSystemTool: Let TrimWhitespace accept a cm::string_view
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index de68bf4..e0005a0 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -197,16 +197,16 @@ std::string cmSystemTools::HelpFileName(cm::string_view str)
return name;
}
-std::string cmSystemTools::TrimWhitespace(const std::string& s)
+std::string cmSystemTools::TrimWhitespace(cm::string_view str)
{
- std::string::const_iterator start = s.begin();
- while (start != s.end() && cm_isspace(*start)) {
+ auto start = str.begin();
+ while (start != str.end() && cm_isspace(*start)) {
++start;
}
- if (start == s.end()) {
- return "";
+ if (start == str.end()) {
+ return std::string();
}
- std::string::const_iterator stop = s.end() - 1;
+ auto stop = str.end() - 1;
while (cm_isspace(*stop)) {
--stop;
}