diff --git a/src/storage/StorageState.cxx b/src/storage/StorageState.cxx index ea408da76..8e63316b5 100644 --- a/src/storage/StorageState.cxx +++ b/src/storage/StorageState.cxx @@ -40,9 +40,7 @@ #pragma GCC diagnostic ignored "-Wcomma" #endif -#include - -#include +#include // for std::hash() #define MOUNT_STATE_BEGIN "mount_begin" #define MOUNT_STATE_END "mount_end" @@ -150,19 +148,16 @@ storage_state_get_hash(const Instance &instance) noexcept if (instance.storage == nullptr) return 0; - std::set mounts; + unsigned result = 0; - const auto visitor = [&mounts](const char *mount_uri, const Storage &storage) { - mounts.emplace(std::string(mount_uri) + ":" + storage.MapUTF8("")); + const std::hash hash; + + const auto visitor = [&result, &hash](const char *mount_uri, const Storage &storage) { + result = result * 33 + hash(mount_uri); + result = result * 33 + hash(storage.MapUTF8("")); }; ((CompositeStorage*)instance.storage)->VisitMounts(visitor); - boost::crc_32_type result; - - for (const auto& mount : mounts) { - result.process_bytes(mount.c_str(), mount.length()); - } - - return result.checksum(); + return result; }