summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-12-18 23:50:31 +0100
committerMax Kellermann <max@musicpd.org>2017-12-21 10:22:00 +0100
commit3d1d779da7112ea3d08217f37cac8fcba78a9808 (patch)
treeb2521c1083758a389ba752e0a2acf469b555c183 /src
parentc88056ba83183bfbdd0f8ed67aaa4ff02802ab11 (diff)
storage/State: use std::set instead of sorting a std::list
Diffstat (limited to 'src')
-rw-r--r--src/storage/StorageState.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/storage/StorageState.cxx b/src/storage/StorageState.cxx
index beeb4eebb..721a0ce37 100644
--- a/src/storage/StorageState.cxx
+++ b/src/storage/StorageState.cxx
@@ -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) {