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
605af61a
Commit
605af61a
authored
Mar 01, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/simple: eliminate UpdateFileInArchive() if archive API is disabled
Reduce some unnecessary overhead.
parent
77e163e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
SongUpdate.cxx
src/SongUpdate.cxx
+10
-2
Song.hxx
src/db/plugins/simple/Song.hxx
+4
-0
No files found.
src/SongUpdate.cxx
View file @
605af61a
...
...
@@ -52,9 +52,13 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
Song
*
song
=
NewFile
(
path_utf8
,
parent
);
//in archive ?
bool
success
=
parent
.
device
==
DEVICE_INARCHIVE
bool
success
=
#ifdef ENABLE_ARCHIVE
parent
.
device
==
DEVICE_INARCHIVE
?
song
->
UpdateFileInArchive
(
storage
)
:
song
->
UpdateFile
(
storage
);
:
#endif
song
->
UpdateFile
(
storage
);
if
(
!
success
)
{
song
->
Free
();
return
nullptr
;
...
...
@@ -113,6 +117,10 @@ Song::UpdateFile(Storage &storage)
return
true
;
}
#endif
#ifdef ENABLE_ARCHIVE
bool
Song
::
UpdateFileInArchive
(
const
Storage
&
storage
)
{
...
...
src/db/plugins/simple/Song.hxx
View file @
605af61a
...
...
@@ -20,6 +20,7 @@
#ifndef MPD_SONG_HXX
#define MPD_SONG_HXX
#include "check.h"
#include "Chrono.hxx"
#include "tag/Tag.hxx"
#include "Compiler.h"
...
...
@@ -109,7 +110,10 @@ struct Song {
void
Free
();
bool
UpdateFile
(
Storage
&
storage
);
#ifdef ENABLE_ARCHIVE
bool
UpdateFileInArchive
(
const
Storage
&
storage
);
#endif
/**
* Returns the URI of the song in UTF-8 encoding, including its
...
...
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