diff options
author | Brad King <brad.king@kitware.com> | 2019-08-07 15:45:02 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-07 15:54:53 (GMT) |
commit | bbf4a5771f8113ce5b88968c4dd3def2fbcd9354 (patch) | |
tree | f24c69250b525f26c2d0cb100468f74d08bccabb /Source/cmUuid.cxx | |
parent | dd53122be5b142e97ac02d1dec62719db29bc39e (diff) | |
parent | 18b0330b86cae2771a54021e390f157a097c8a99 (diff) | |
download | CMake-bbf4a5771f8113ce5b88968c4dd3def2fbcd9354.zip CMake-bbf4a5771f8113ce5b88968c4dd3def2fbcd9354.tar.gz CMake-bbf4a5771f8113ce5b88968c4dd3def2fbcd9354.tar.bz2 |
Merge topic 'tidy_inefficient_string'
18b0330b86 clang-tidy: Enable performance-inefficient-string-concatenation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3648
Diffstat (limited to 'Source/cmUuid.cxx')
-rw-r--r-- | Source/cmUuid.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx index 51ecbd1..0dc6ca7 100644 --- a/Source/cmUuid.cxx +++ b/Source/cmUuid.cxx @@ -114,14 +114,12 @@ std::string cmUuid::BinaryToString(const unsigned char* input) const std::string cmUuid::ByteToHex(unsigned char byte) const { - std::string result; + std::string result(" "); for (int i = 0; i < 2; ++i) { unsigned char rest = byte % 16; byte /= 16; - char c = (rest < 0xA) ? char('0' + rest) : char('a' + (rest - 0xA)); - - result = c + result; + result.at(1 - i) = c; } return result; |