DetachedSong: move code from Update() to LoadFile()

Avoid duplicate AllocatedPath::FromUTF8() invocations in two callers.
This commit is contained in:
Max Kellermann
2015-10-20 12:10:42 +02:00
parent 76f85e6f7b
commit fc2154ee92
5 changed files with 36 additions and 26 deletions

View File

@@ -121,9 +121,9 @@ DatabaseDetachSong(gcc_unused const Database &db,
}
bool
DetachedSong::Update()
DetachedSong::LoadFile(Path path)
{
if (strcmp(GetURI(), uri1) == 0) {
if (path.ToUTF8() == uri1) {
SetTag(MakeTag1a());
return true;
}