diff --git a/Analyser/Static/ZXSpectrum/StaticAnalyser.cpp b/Analyser/Static/ZXSpectrum/StaticAnalyser.cpp index 396c67f23..13a76841f 100644 --- a/Analyser/Static/ZXSpectrum/StaticAnalyser.cpp +++ b/Analyser/Static/ZXSpectrum/StaticAnalyser.cpp @@ -13,6 +13,8 @@ #include "Target.hpp" +#include + namespace { bool IsSpectrumTape(const std::shared_ptr &tape) { @@ -47,10 +49,8 @@ bool IsSpectrumDisk(const std::shared_ptr &disk) { if(!boot_sector) return false; // Test that the contents of the boot sector sum to 3, modulo 256. - uint8_t byte_sum = 0; - for(auto byte: boot_sector->samples[0]) { - byte_sum += byte; - } + const auto byte_sum = static_cast( + std::accumulate(boot_sector->samples[0].begin(), boot_sector->samples[0].end(), 0)); return byte_sum == 3; }