db/LightSong: make Tag a reference
This enforces the "not nullptr" rule.
This commit is contained in:
@@ -57,9 +57,9 @@ struct LightSong {
|
||||
const char *real_uri;
|
||||
|
||||
/**
|
||||
* Must not be nullptr.
|
||||
* Metadata.
|
||||
*/
|
||||
const Tag *tag;
|
||||
const Tag &tag;
|
||||
|
||||
/**
|
||||
* The time stamp of the last file modification. A negative
|
||||
@@ -78,6 +78,9 @@ struct LightSong {
|
||||
*/
|
||||
SongTime end_time;
|
||||
|
||||
explicit LightSong(const Tag &_tag) noexcept
|
||||
:tag(_tag) {}
|
||||
|
||||
gcc_pure
|
||||
std::string GetURI() const noexcept {
|
||||
if (directory == nullptr)
|
||||
|
Reference in New Issue
Block a user