diff options
author | Brad King <brad.king@kitware.com> | 2015-02-10 14:37:57 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-02-10 14:37:57 (GMT) |
commit | e2619c13f727504b7368e0bf156c17112ee81568 (patch) | |
tree | ab0df7233b35770acf1ce7d0d9bde2824cc6419e /Source/cmSystemTools.cxx | |
parent | c548ddc1724c9c96bab04d2f51d1740360bcb737 (diff) | |
parent | d8639733a42149ca1402dcae427f2142ab0cf037 (diff) | |
download | CMake-e2619c13f727504b7368e0bf156c17112ee81568.zip CMake-e2619c13f727504b7368e0bf156c17112ee81568.tar.gz CMake-e2619c13f727504b7368e0bf156c17112ee81568.tar.bz2 |
Merge topic 'use-algorithms'
d8639733 cmSystemTools: Remove unnecessary comparison.
803317aa cmSystemTools: Early return if size makes later comparison false.
11093a03 Replace temporary bool by inlining warning condition.
6cd2ee95 Replace loop with member algorithm.
94e993a0 cmComputeLinkDepends: Remove temporary iterator copy.
69dbe51b Replace loop with algorithm.
683fafea Replace a loop with std::transform.
63f584b6 Replace while loop with member insert.
74c4d9d2 Take a size check outside of an inner loop.
71d47115 Use insert member instead of back_inserter.
39622c99 Convert while loop to member insert.
a7fcc148 Convert loop to algorithm.
d46c4f07 Extract a prefix variable from loop.
d59913f0 Take computation out of loop.
3f3db744 cmMakefile: Remove ExpandSourceListArguments.
bd990c80 Remove use of ExpandSourceListArguments.
...
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index d6f8d6b..7dd6121 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -367,13 +367,17 @@ bool cmSystemTools::IsInternallyOn(const char* val) return false; } std::basic_string<char> v = val; + if (v.size() > 4) + { + return false; + } for(std::basic_string<char>::iterator c = v.begin(); c != v.end(); c++) { *c = static_cast<char>(toupper(*c)); } - return (v == "I_ON" || v == "i_on"); + return v == "I_ON"; } bool cmSystemTools::IsOn(const char* val) @@ -2702,7 +2706,7 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg, } if(se_count == 2 && se[1]->IndexInSection < se[0]->IndexInSection) { - cmsys_stl::swap(se[0], se[1]); + std::swap(se[0], se[1]); } // Get the size of the dynamic section header. |