summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoRcc.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-08-26 15:25:44 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-08-27 15:31:46 (GMT)
commit619a92eacd689d867343c05fff568bf1dc9467b7 (patch)
treeb080b51089c9644c5641d615ed4403c17443dac5 /Source/cmQtAutoRcc.cxx
parent10dc684508ca0055f1558a40f27777a6bba6bc1c (diff)
downloadCMake-619a92eacd689d867343c05fff568bf1dc9467b7.zip
CMake-619a92eacd689d867343c05fff568bf1dc9467b7.tar.gz
CMake-619a92eacd689d867343c05fff568bf1dc9467b7.tar.bz2
Autogen: cmQtAutoRcc settings hash computation optimizations
Diffstat (limited to 'Source/cmQtAutoRcc.cxx')
-rw-r--r--Source/cmQtAutoRcc.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx
index 1cceaf1..e931346 100644
--- a/Source/cmQtAutoRcc.cxx
+++ b/Source/cmQtAutoRcc.cxx
@@ -13,6 +13,8 @@
#include "cmSystemTools.h"
#include "cm_string_view.hxx"
+#include <algorithm>
+
cmQtAutoRcc::cmQtAutoRcc() = default;
cmQtAutoRcc::~cmQtAutoRcc() = default;
@@ -164,15 +166,19 @@ bool cmQtAutoRcc::SettingsFileRead()
{
// Compose current settings strings
{
- cmCryptoHash crypt(cmCryptoHash::AlgoSHA256);
- std::string const sep(" ~~~ ");
- {
- std::string str =
- cmStrCat(RccExecutable_, sep, cmJoin(RccListOptions_, ";"), sep,
- QrcFile_, sep, RccPathChecksum_, sep, RccFileName_, sep,
- cmJoin(Options_, ";"), sep, cmJoin(Inputs_, ";"), sep);
- SettingsString_ = crypt.HashString(str);
- }
+ cmCryptoHash cryptoHash(cmCryptoHash::AlgoSHA256);
+ auto cha = [&cryptoHash](cm::string_view value) {
+ cryptoHash.Append(value);
+ cryptoHash.Append(";");
+ };
+ cha(RccExecutable_);
+ std::for_each(RccListOptions_.begin(), RccListOptions_.end(), cha);
+ cha(QrcFile_);
+ cha(RccPathChecksum_);
+ cha(RccFileName_);
+ std::for_each(Options_.begin(), Options_.end(), cha);
+ std::for_each(Inputs_.begin(), Inputs_.end(), cha);
+ SettingsString_ = cryptoHash.FinalizeHex();
}
// Make sure the settings file exists