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
6ec5089c
You need to sign in or sign up before continuing.
Commit
6ec5089c
authored
3 years ago
by
Rosen Penev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove std::make_pair
make_pair is an old C++98 function that can be replaced by modern shorter constructs. Signed-off-by:
Rosen Penev
<
rosenp@gmail.com
>
parent
15f419e1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
15 additions
and
18 deletions
+15
-18
Permission.cxx
src/Permission.cxx
+1
-2
Count.cxx
src/db/Count.cxx
+1
-1
InotifyUpdate.cxx
src/db/update/InotifyUpdate.cxx
+1
-2
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+1
-1
HybridDsdDecoderPlugin.cxx
src/decoder/plugins/HybridDsdDecoderPlugin.cxx
+1
-1
Paranoia.hxx
src/lib/cdio/Paranoia.hxx
+2
-2
Filter.hxx
src/lib/ffmpeg/Filter.hxx
+2
-2
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+2
-3
Database.cxx
src/sticker/Database.cxx
+1
-1
ISO8601.cxx
src/time/ISO8601.cxx
+3
-3
No files found.
src/Permission.cxx
View file @
6ec5089c
...
...
@@ -98,8 +98,7 @@ initPermissions(const ConfigData &config)
std
::
string
password
(
value
,
separator
);
unsigned
permission
=
parsePermissions
(
separator
+
1
);
permission_passwords
.
insert
(
std
::
make_pair
(
std
::
move
(
password
),
permission
));
permission_passwords
.
emplace
(
std
::
move
(
password
),
permission
);
});
}
...
...
This diff is collapsed.
Click to expand it.
src/db/Count.cxx
View file @
6ec5089c
...
...
@@ -78,7 +78,7 @@ static void
CollectGroupCounts
(
TagCountMap
&
map
,
const
Tag
&
tag
,
const
char
*
value
)
noexcept
{
auto
&
s
=
map
.
insert
(
std
::
make_pair
(
value
,
SearchStats
()
)).
first
->
second
;
auto
&
s
=
map
.
emplace
(
value
,
SearchStats
(
)).
first
->
second
;
++
s
.
n_songs
;
if
(
!
tag
.
duration
.
IsNegative
())
s
.
total_duration
+=
tag
.
duration
;
...
...
This diff is collapsed.
Click to expand it.
src/db/update/InotifyUpdate.cxx
View file @
6ec5089c
...
...
@@ -109,8 +109,7 @@ static std::map<int, WatchDirectory *> inotify_directories;
static
void
tree_add_watch_directory
(
WatchDirectory
*
directory
)
{
inotify_directories
.
insert
(
std
::
make_pair
(
directory
->
descriptor
,
directory
));
inotify_directories
.
emplace
(
directory
->
descriptor
,
directory
);
}
static
void
...
...
This diff is collapsed.
Click to expand it.
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
6ec5089c
...
...
@@ -317,7 +317,7 @@ faad_get_file_time(InputStream &is)
}
}
return
std
::
make_pair
(
recognized
,
duration
)
;
return
{
recognized
,
duration
}
;
}
static
void
...
...
This diff is collapsed.
Click to expand it.
src/decoder/plugins/HybridDsdDecoderPlugin.cxx
View file @
6ec5089c
...
...
@@ -160,7 +160,7 @@ FindHybridDsdData(DecoderClient &client, InputStream &input)
if
(
!
found_version
||
!
audio_format
.
IsValid
())
throw
UnsupportedFile
();
return
std
::
make_pair
(
audio_format
,
remaining
)
;
return
{
audio_format
,
remaining
}
;
}
/* skip this chunk payload */
...
...
This diff is collapsed.
Click to expand it.
src/lib/cdio/Paranoia.hxx
View file @
6ec5089c
...
...
@@ -85,7 +85,7 @@ public:
auto
last
=
cdio_cddap_disc_lastsector
(
drv
);
if
(
first
<
0
||
last
<
0
)
throw
std
::
runtime_error
(
"Failed to get disc audio sectors"
);
return
std
::
make_
pair
(
first
,
last
);
return
std
::
pair
(
first
,
last
);
}
gcc_pure
...
...
@@ -98,7 +98,7 @@ public:
auto
last
=
cdio_cddap_track_lastsector
(
drv
,
i
);
if
(
first
<
0
||
last
<
0
)
throw
std
::
runtime_error
(
"Invalid track number"
);
return
std
::
make_
pair
(
first
,
last
);
return
std
::
pair
(
first
,
last
);
}
gcc_pure
...
...
This diff is collapsed.
Click to expand it.
src/lib/ffmpeg/Filter.hxx
View file @
6ec5089c
...
...
@@ -152,7 +152,7 @@ public:
if
(
err
<
0
)
throw
MakeFfmpegError
(
err
,
"avfilter_graph_parse_ptr() failed"
);
return
std
::
make_pair
(
std
::
move
(
inputs
),
std
::
move
(
outputs
))
;
return
{
std
::
move
(
inputs
),
std
::
move
(
outputs
)}
;
}
void
ParseSingleInOut
(
const
char
*
filters
,
AVFilterContext
&
in
,
...
...
@@ -165,7 +165,7 @@ public:
if
(
err
<
0
)
throw
MakeFfmpegError
(
err
,
"avfilter_graph_parse2() failed"
);
return
std
::
make_pair
(
FilterInOut
{
inputs
},
FilterInOut
{
outputs
})
;
return
{
FilterInOut
{
inputs
},
FilterInOut
{
outputs
}}
;
}
void
CheckAndConfigure
()
{
...
...
This diff is collapsed.
Click to expand it.
src/output/plugins/AlsaOutputPlugin.cxx
View file @
6ec5089c
...
...
@@ -450,10 +450,9 @@ AlsaOutput::GetAttributes() const noexcept
const
std
::
lock_guard
<
Mutex
>
lock
(
attributes_mutex
);
return
{
std
::
make_pair
(
"allowed_formats"
,
Alsa
::
ToString
(
allowed_formats
)),
{
"allowed_formats"
,
Alsa
::
ToString
(
allowed_formats
)},
#ifdef ENABLE_DSD
std
::
make_pair
(
"dop"
,
dop_setting
?
"1"
:
"0"
)
,
{
"dop"
,
dop_setting
?
"1"
:
"0"
}
,
#endif
};
}
...
...
This diff is collapsed.
Click to expand it.
src/sticker/Database.cxx
View file @
6ec5089c
...
...
@@ -163,7 +163,7 @@ StickerDatabase::ListValues(std::map<std::string, std::string> &table,
ExecuteForEach
(
s
,
[
s
,
&
table
](){
const
char
*
name
=
(
const
char
*
)
sqlite3_column_text
(
s
,
0
);
const
char
*
value
=
(
const
char
*
)
sqlite3_column_text
(
s
,
1
);
table
.
insert
(
std
::
make_pair
(
name
,
value
)
);
table
.
emplace
(
name
,
value
);
});
}
...
...
This diff is collapsed.
Click to expand it.
src/time/ISO8601.cxx
View file @
6ec5089c
...
...
@@ -68,7 +68,7 @@ ParseTimeZoneOffsetRaw(const char *&s)
unsigned
long
value
=
std
::
strtoul
(
s
,
&
endptr
,
10
);
if
(
endptr
==
s
+
4
)
{
s
=
endptr
;
return
std
::
make_pair
(
value
/
100
,
value
%
100
)
;
return
{
value
/
100
,
value
%
100
}
;
}
else
if
(
endptr
==
s
+
2
)
{
s
=
endptr
;
...
...
@@ -82,7 +82,7 @@ ParseTimeZoneOffsetRaw(const char *&s)
s
=
endptr
;
}
return
std
::
make_pair
(
hours
,
minutes
)
;
return
{
hours
,
minutes
}
;
}
else
throw
std
::
invalid_argument
(
"Failed to parse time zone offset"
);
}
...
...
@@ -234,6 +234,6 @@ ParseISO8601(const char *s)
if
(
*
s
!=
0
)
throw
std
::
invalid_argument
(
"Garbage at end of time stamp"
);
return
std
::
make_pair
(
tp
,
precision
)
;
return
{
tp
,
precision
}
;
#endif
/* !_WIN32 */
}
This diff is collapsed.
Click to expand it.
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