db/simple/Song: convert "uri" to a std::string

No longer allocate it as a "VarSize".  This used to be a clever trick
to save memory 10 years ago, but these days, keeping the code
maintainable seems more important than saving a few kilobytes of
memory.
This commit is contained in:
Max Kellermann
2019-09-03 20:23:46 +02:00
parent af3f637d3f
commit 7f9a8b8748
10 changed files with 17 additions and 78 deletions

View File

@@ -20,7 +20,6 @@
#include "Directory.hxx"
#include "SongSort.hxx"
#include "Song.hxx"
#include "Disposer.hxx"
#include "Mount.hxx"
#include "db/LightDirectory.hxx"
#include "song/LightSong.hxx"
@@ -51,7 +50,7 @@ Directory::~Directory() noexcept
mounted_database.reset();
}
songs.clear_and_dispose(SongDisposer());
songs.clear_and_dispose(DeleteDisposer());
children.clear_and_dispose(DeleteDisposer());
}
@@ -192,7 +191,7 @@ Directory::FindSong(const char *name_utf8) const noexcept
for (auto &song : songs) {
assert(song.parent == this);
if (strcmp(song.uri, name_utf8) == 0)
if (song.uri == name_utf8)
return &song;
}