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
40483d84
Commit
40483d84
authored
Sep 07, 2021
by
Rosen Penev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix wrong emplace usage
emplace already calls std::pair. No need for it again. No need to emplace when calling std::make_shared. Signed-off-by:
Rosen Penev
<
rosenp@gmail.com
>
parent
6ec5089c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
UdisksNeighborPlugin.cxx
src/neighbor/plugins/UdisksNeighborPlugin.cxx
+2
-2
MultipleOutputs.cxx
src/output/MultipleOutputs.cxx
+2
-3
SnapcastOutputPlugin.cxx
src/output/plugins/snapcast/SnapcastOutputPlugin.cxx
+1
-1
No files found.
src/neighbor/plugins/UdisksNeighborPlugin.cxx
View file @
40483d84
...
...
@@ -193,11 +193,11 @@ UdisksNeighborExplorer::Insert(UDisks2::Object &&o) noexcept
{
const
std
::
lock_guard
<
Mutex
>
protect
(
mutex
);
auto
i
=
by_uri
.
emplace
(
std
::
make_pair
(
o
.
GetUri
(),
info
)
);
auto
i
=
by_uri
.
emplace
(
o
.
GetUri
(),
info
);
if
(
!
i
.
second
)
i
.
first
->
second
=
info
;
by_path
.
emplace
(
std
::
make_pair
(
o
.
path
,
i
.
first
)
);
by_path
.
emplace
(
o
.
path
,
i
.
first
);
// TODO: do we need to remove a conflicting path?
}
...
...
src/output/MultipleOutputs.cxx
View file @
40483d84
...
...
@@ -134,7 +134,7 @@ MultipleOutputs::Add(std::unique_ptr<FilteredAudioOutput> output,
bool
enable
)
noexcept
{
// TODO: this operation needs to be protected with a mutex
outputs
.
emplace
_back
(
std
::
make_unique
<
AudioOutputControl
>
(
std
::
move
(
output
),
outputs
.
push
_back
(
std
::
make_unique
<
AudioOutputControl
>
(
std
::
move
(
output
),
client
));
outputs
.
back
()
->
LockSetEnabled
(
enable
);
...
...
@@ -147,8 +147,7 @@ MultipleOutputs::AddCopy(AudioOutputControl *outputControl,
bool
enable
)
noexcept
{
// TODO: this operation needs to be protected with a mutex
outputs
.
emplace_back
(
std
::
make_unique
<
AudioOutputControl
>
(
outputControl
,
client
));
outputs
.
push_back
(
std
::
make_unique
<
AudioOutputControl
>
(
outputControl
,
client
));
outputs
.
back
()
->
LockSetEnabled
(
enable
);
...
...
src/output/plugins/snapcast/SnapcastOutputPlugin.cxx
View file @
40483d84
...
...
@@ -346,7 +346,7 @@ SnapcastOutput::Play(const void *chunk, size_t size)
inject_event
.
Schedule
();
const
ConstBuffer
payload
{
buffer
,
nbytes
};
chunks
.
emplace
(
std
::
make_shared
<
SnapcastChunk
>
(
now
,
AllocatedArray
{
payload
}));
chunks
.
push
(
std
::
make_shared
<
SnapcastChunk
>
(
now
,
AllocatedArray
{
payload
}));
}
return
size
;
...
...
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