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
17097d96
Commit
17097d96
authored
Feb 07, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/{Count,Print}: use tag_print(), eliminate duplicate code
parent
a3e28c2d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
TagPrint.cxx
src/TagPrint.cxx
+1
-1
Count.cxx
src/db/Count.cxx
+2
-1
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+3
-3
No files found.
src/TagPrint.cxx
View file @
17097d96
...
...
@@ -41,7 +41,7 @@ void
tag_print_values
(
Response
&
r
,
const
Tag
&
tag
)
{
for
(
const
auto
&
i
:
tag
)
r
.
Format
(
"%s: %s
\n
"
,
tag_item_names
[
i
.
type
]
,
i
.
value
);
tag_print
(
r
,
i
.
type
,
i
.
value
);
}
void
...
...
src/db/Count.cxx
View file @
17097d96
...
...
@@ -25,6 +25,7 @@
#include "client/Response.hxx"
#include "LightSong.hxx"
#include "tag/Tag.hxx"
#include "TagPrint.hxx"
#include <functional>
#include <map>
...
...
@@ -57,7 +58,7 @@ Print(Response &r, TagType group, const TagCountMap &m)
assert
(
unsigned
(
group
)
<
TAG_NUM_OF_ITEM_TYPES
);
for
(
const
auto
&
i
:
m
)
{
r
.
Format
(
"%s: %s
\n
"
,
tag_item_names
[
group
]
,
i
.
first
.
c_str
());
tag_print
(
r
,
group
,
i
.
first
.
c_str
());
PrintSearchStats
(
r
,
i
.
second
);
}
}
...
...
src/db/DatabasePrint.cxx
View file @
17097d96
...
...
@@ -23,6 +23,7 @@
#include "SongFilter.hxx"
#include "SongPrint.hxx"
#include "TimePrint.hxx"
#include "TagPrint.hxx"
#include "client/Response.hxx"
#include "Partition.hxx"
#include "tag/Tag.hxx"
...
...
@@ -192,12 +193,11 @@ PrintUniqueTag(Response &r, TagType tag_type,
{
const
char
*
value
=
tag
.
GetValue
(
tag_type
);
assert
(
value
!=
nullptr
);
r
.
Format
(
"%s: %s
\n
"
,
tag_item_names
[
tag_type
]
,
value
);
tag_print
(
r
,
tag_type
,
value
);
for
(
const
auto
&
item
:
tag
)
if
(
item
.
type
!=
tag_type
)
r
.
Format
(
"%s: %s
\n
"
,
tag_item_names
[
item
.
type
],
item
.
value
);
tag_print
(
r
,
item
.
type
,
item
.
value
);
}
void
...
...
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