*: use references instead of pointers
This commit is contained in:
@@ -49,10 +49,8 @@ enum {
|
||||
};
|
||||
|
||||
void
|
||||
db_save_internal(FILE *fp, const Directory *music_root)
|
||||
db_save_internal(FILE *fp, const Directory &music_root)
|
||||
{
|
||||
assert(music_root != nullptr);
|
||||
|
||||
fprintf(fp, "%s\n", DIRECTORY_INFO_BEGIN);
|
||||
fprintf(fp, DB_FORMAT_PREFIX "%u\n", DB_FORMAT);
|
||||
fprintf(fp, "%s%s\n", DIRECTORY_MPD_VERSION, VERSION);
|
||||
@@ -68,7 +66,7 @@ db_save_internal(FILE *fp, const Directory *music_root)
|
||||
}
|
||||
|
||||
bool
|
||||
db_load_internal(TextFile &file, Directory *music_root, Error &error)
|
||||
db_load_internal(TextFile &file, Directory &music_root, Error &error)
|
||||
{
|
||||
char *line;
|
||||
int format = 0;
|
||||
@@ -76,8 +74,6 @@ db_load_internal(TextFile &file, Directory *music_root, Error &error)
|
||||
bool success;
|
||||
bool tags[TAG_NUM_OF_ITEM_TYPES];
|
||||
|
||||
assert(music_root != nullptr);
|
||||
|
||||
/* get initial info */
|
||||
line = file.ReadLine();
|
||||
if (line == nullptr || strcmp(DIRECTORY_INFO_BEGIN, line) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user