db/update/Service: pass std::string_view to Enqueue()

This commit is contained in:
Max Kellermann 2020-04-03 17:02:02 +02:00
parent dd831d3922
commit 212401d687
2 changed files with 3 additions and 4 deletions

View File

@ -169,7 +169,7 @@ UpdateService::GenerateId() noexcept
} }
unsigned unsigned
UpdateService::Enqueue(const char *_path, bool discard) UpdateService::Enqueue(std::string_view path, bool discard)
{ {
assert(GetEventLoop().IsInside()); assert(GetEventLoop().IsInside());
@ -178,8 +178,6 @@ UpdateService::Enqueue(const char *_path, bool discard)
SimpleDatabase *db2; SimpleDatabase *db2;
Storage *storage2; Storage *storage2;
std::string_view path(_path);
Directory::LookupResult lr; Directory::LookupResult lr;
{ {
const ScopeDatabaseLock protect; const ScopeDatabaseLock protect;

View File

@ -27,6 +27,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include <memory> #include <memory>
#include <string_view>
class SimpleDatabase; class SimpleDatabase;
class DatabaseListener; class DatabaseListener;
@ -90,7 +91,7 @@ public:
* @return the job id * @return the job id
*/ */
gcc_nonnull_all gcc_nonnull_all
unsigned Enqueue(const char *path, bool discard); unsigned Enqueue(std::string_view path, bool discard);
/** /**
* Clear the queue and cancel the current update. Does not * Clear the queue and cancel the current update. Does not