db/simple: pass std::string_view to Directory::LookupDirectory()

This commit is contained in:
Max Kellermann
2020-04-03 17:03:35 +02:00
parent 9f8dc31b50
commit dd831d3922
5 changed files with 31 additions and 19 deletions
+4 -2
View File
@@ -169,7 +169,7 @@ UpdateService::GenerateId() noexcept
}
unsigned
UpdateService::Enqueue(const char *path, bool discard)
UpdateService::Enqueue(const char *_path, bool discard)
{
assert(GetEventLoop().IsInside());
@@ -178,6 +178,8 @@ UpdateService::Enqueue(const char *path, bool discard)
SimpleDatabase *db2;
Storage *storage2;
std::string_view path(_path);
Directory::LookupResult lr;
{
const ScopeDatabaseLock protect;
@@ -192,7 +194,7 @@ UpdateService::Enqueue(const char *path, bool discard)
if (db2 == nullptr)
throw std::runtime_error("Cannot update this type of database");
if (lr.rest == nullptr) {
if (lr.rest.data() == nullptr) {
storage2 = storage.GetMount(path);
path = "";
} else {