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
986dd2fa
Commit
986dd2fa
authored
Apr 24, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/Helpers: move code to CheckUniqueTag()
parent
3965b490
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
Helpers.cxx
src/db/Helpers.cxx
+12
-6
No files found.
src/db/Helpers.cxx
View file @
986dd2fa
...
...
@@ -39,20 +39,26 @@ struct StringLess {
typedef
std
::
set
<
const
char
*
,
StringLess
>
StringSet
;
static
bool
C
ollectTags
(
StringSet
&
set
,
TagType
tag_type
,
const
LightSong
&
song
)
C
heckUniqueTag
(
StringSet
&
set
,
const
Tag
&
tag
,
TagType
type
)
{
assert
(
song
.
tag
!=
nullptr
);
const
Tag
&
tag
=
*
song
.
tag
;
bool
found
=
false
;
for
(
unsigned
i
=
0
;
i
<
tag
.
num_items
;
++
i
)
{
if
(
tag
.
items
[
i
]
->
type
==
t
ag_t
ype
)
{
if
(
tag
.
items
[
i
]
->
type
==
type
)
{
set
.
insert
(
tag
.
items
[
i
]
->
value
);
found
=
true
;
}
}
if
(
!
found
)
return
found
;
}
static
bool
CollectTags
(
StringSet
&
set
,
TagType
tag_type
,
const
LightSong
&
song
)
{
assert
(
song
.
tag
!=
nullptr
);
const
Tag
&
tag
=
*
song
.
tag
;
if
(
!
CheckUniqueTag
(
set
,
tag
,
tag_type
))
set
.
insert
(
""
);
return
true
;
...
...
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