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
3fe7f273
Commit
3fe7f273
authored
Apr 24, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sticker/Database: eliminate sticker_foreach()
parent
0dccadff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
35 deletions
+5
-35
StickerDatabase.cxx
src/sticker/StickerDatabase.cxx
+0
-10
StickerDatabase.hxx
src/sticker/StickerDatabase.hxx
+0
-13
StickerPrint.cxx
src/sticker/StickerPrint.cxx
+4
-11
StickerPrint.hxx
src/sticker/StickerPrint.hxx
+1
-1
No files found.
src/sticker/StickerDatabase.cxx
View file @
3fe7f273
...
@@ -314,16 +314,6 @@ sticker_delete_value(const char *type, const char *uri, const char *name)
...
@@ -314,16 +314,6 @@ sticker_delete_value(const char *type, const char *uri, const char *name)
return
modified
;
return
modified
;
}
}
void
sticker_foreach
(
const
Sticker
&
sticker
,
void
(
*
func
)(
const
char
*
name
,
const
char
*
value
,
void
*
user_data
),
void
*
user_data
)
{
for
(
const
auto
&
i
:
sticker
.
table
)
func
(
i
.
first
.
c_str
(),
i
.
second
.
c_str
(),
user_data
);
}
Sticker
Sticker
sticker_load
(
const
char
*
type
,
const
char
*
uri
)
sticker_load
(
const
char
*
type
,
const
char
*
uri
)
{
{
...
...
src/sticker/StickerDatabase.hxx
View file @
3fe7f273
...
@@ -109,19 +109,6 @@ bool
...
@@ -109,19 +109,6 @@ bool
sticker_delete_value
(
const
char
*
type
,
const
char
*
uri
,
const
char
*
name
);
sticker_delete_value
(
const
char
*
type
,
const
char
*
uri
,
const
char
*
name
);
/**
/**
* Iterates over all sticker items in a sticker.
*
* @param sticker the sticker object
* @param func a callback function
* @param user_data an opaque pointer for the callback function
*/
void
sticker_foreach
(
const
Sticker
&
sticker
,
void
(
*
func
)(
const
char
*
name
,
const
char
*
value
,
void
*
user_data
),
void
*
user_data
);
/**
* Loads the sticker for the specified resource.
* Loads the sticker for the specified resource.
*
*
* Throws #SqliteError on error.
* Throws #SqliteError on error.
...
...
src/sticker/StickerPrint.cxx
View file @
3fe7f273
/*
/*
* Copyright 2003-201
8
The Music Player Daemon Project
* Copyright 2003-201
9
The Music Player Daemon Project
* http://www.musicpd.org
* http://www.musicpd.org
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
*/
*/
#include "StickerPrint.hxx"
#include "StickerPrint.hxx"
#include "Sticker
Database
.hxx"
#include "Sticker.hxx"
#include "client/Response.hxx"
#include "client/Response.hxx"
void
void
...
@@ -28,16 +28,9 @@ sticker_print_value(Response &r,
...
@@ -28,16 +28,9 @@ sticker_print_value(Response &r,
r
.
Format
(
"sticker: %s=%s
\n
"
,
name
,
value
);
r
.
Format
(
"sticker: %s=%s
\n
"
,
name
,
value
);
}
}
static
void
print_sticker_cb
(
const
char
*
name
,
const
char
*
value
,
void
*
data
)
{
auto
&
r
=
*
(
Response
*
)
data
;
sticker_print_value
(
r
,
name
,
value
);
}
void
void
sticker_print
(
Response
&
r
,
const
Sticker
&
sticker
)
sticker_print
(
Response
&
r
,
const
Sticker
&
sticker
)
{
{
sticker_foreach
(
sticker
,
print_sticker_cb
,
&
r
);
for
(
const
auto
&
i
:
sticker
.
table
)
sticker_print_value
(
r
,
i
.
first
.
c_str
(),
i
.
second
.
c_str
());
}
}
src/sticker/StickerPrint.hxx
View file @
3fe7f273
/*
/*
* Copyright 2003-201
8
The Music Player Daemon Project
* Copyright 2003-201
9
The Music Player Daemon Project
* http://www.musicpd.org
* http://www.musicpd.org
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
...
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