Commit 3d1d779d authored by Max Kellermann's avatar Max Kellermann

storage/State: use std::set instead of sorting a std::list

parent c88056ba
......@@ -35,7 +35,7 @@
#include "IOThread.hxx"
#include "Log.hxx"
#include <list>
#include <set>
#include <boost/crc.hpp>
#define MOUNT_STATE_BEGIN "mount_begin"
......@@ -118,16 +118,14 @@ storage_state_restore(const char *line, TextFile &file, Instance &instance)
unsigned
storage_state_get_hash(const Instance &instance)
{
std::list<std::string> mounts;
std::set<std::string> mounts;
const auto visitor = [&mounts](const char *mount_uri, const Storage &storage) {
mounts.push_back(std::string(mount_uri) + ":" + storage.MapUTF8(""));
mounts.emplace(std::string(mount_uri) + ":" + storage.MapUTF8(""));
};
((CompositeStorage*)instance.storage)->VisitMounts(visitor);
mounts.sort();
boost::crc_32_type result;
for (auto mount: mounts) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment