Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3d1d779d
Commit
3d1d779d
authored
Dec 18, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/State: use std::set instead of sorting a std::list
parent
c88056ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
StorageState.cxx
src/storage/StorageState.cxx
+3
-5
No files found.
src/storage/StorageState.cxx
View file @
3d1d779d
...
...
@@ -35,7 +35,7 @@
#include "IOThread.hxx"
#include "Log.hxx"
#include <
lis
t>
#include <
se
t>
#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
::
lis
t
<
std
::
string
>
mounts
;
std
::
se
t
<
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment