From b82b56970ba0d2d141a9798c7fa546805bd97158 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 14 Oct 2021 12:52:52 +0200 Subject: [PATCH] db/simple/Song: reorder fields for better packing --- src/db/plugins/simple/Song.cxx | 8 ++++---- src/db/plugins/simple/Song.hxx | 32 ++++++++++++++++---------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx index 162a2732f..e1d6290dd 100644 --- a/src/db/plugins/simple/Song.cxx +++ b/src/db/plugins/simple/Song.cxx @@ -29,13 +29,13 @@ #include "util/IterableSplitString.hxx" Song::Song(DetachedSong &&other, Directory &_parent) noexcept - :tag(std::move(other.WritableTag())), - parent(_parent), + :parent(_parent), + filename(other.GetURI()), + tag(std::move(other.WritableTag())), mtime(other.GetLastModified()), start_time(other.GetStartTime()), end_time(other.GetEndTime()), - audio_format(other.GetAudioFormat()), - filename(other.GetURI()) + audio_format(other.GetAudioFormat()) { } diff --git a/src/db/plugins/simple/Song.hxx b/src/db/plugins/simple/Song.hxx index 795a066d0..e4a176c38 100644 --- a/src/db/plugins/simple/Song.hxx +++ b/src/db/plugins/simple/Song.hxx @@ -56,13 +56,27 @@ struct Song { */ Hook siblings; - Tag tag; - /** * The #Directory that contains this song. */ Directory &parent; + /** + * The file name. + */ + std::string filename; + + /** + * If non-empty, then this object does not describe a file + * within the `music_directory`, but some sort of symbolic + * link pointing to this value. It can be an absolute URI + * (i.e. with URI scheme) or a URI relative to this object + * (which may begin with one or more "../"). + */ + std::string target; + + Tag tag; + /** * The time stamp of the last file modification. A negative * value means that this is unknown/unavailable. @@ -87,20 +101,6 @@ struct Song { */ AudioFormat audio_format = AudioFormat::Undefined(); - /** - * The file name. - */ - std::string filename; - - /** - * If non-empty, then this object does not describe a file - * within the `music_directory`, but some sort of symbolic - * link pointing to this value. It can be an absolute URI - * (i.e. with URI scheme) or a URI relative to this object - * (which may begin with one or more "../"). - */ - std::string target; - template Song(F &&_filename, Directory &_parent) noexcept :parent(_parent), filename(std::forward(_filename)) {}