db/LightSong: make Tag a reference
This enforces the "not nullptr" rule.
This commit is contained in:
@@ -26,18 +26,17 @@
|
||||
DetachedSong::DetachedSong(const LightSong &other)
|
||||
:uri(other.GetURI()),
|
||||
real_uri(other.real_uri != nullptr ? other.real_uri : ""),
|
||||
tag(*other.tag),
|
||||
tag(other.tag),
|
||||
mtime(other.mtime),
|
||||
start_time(other.start_time),
|
||||
end_time(other.end_time) {}
|
||||
|
||||
DetachedSong::operator LightSong() const noexcept
|
||||
{
|
||||
LightSong result;
|
||||
LightSong result(tag);
|
||||
result.directory = nullptr;
|
||||
result.uri = uri.c_str();
|
||||
result.real_uri = real_uri.empty() ? nullptr : real_uri.c_str();
|
||||
result.tag = &tag;
|
||||
result.mtime = mtime;
|
||||
result.start_time = start_time;
|
||||
result.end_time = end_time;
|
||||
|
||||
Reference in New Issue
Block a user