Commit 66bcf04c authored by Max Kellermann's avatar Max Kellermann

db/update/Queue: pass std::string_view to Push()

parent 12b97bbe
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
bool bool
UpdateQueue::Push(SimpleDatabase &db, Storage &storage, UpdateQueue::Push(SimpleDatabase &db, Storage &storage,
const char *path, bool discard, unsigned id) noexcept std::string_view path, bool discard, unsigned id) noexcept
{ {
if (update_queue.size() >= MAX_UPDATE_QUEUE_SIZE) if (update_queue.size() >= MAX_UPDATE_QUEUE_SIZE)
return false; return false;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "util/Compiler.h" #include "util/Compiler.h"
#include <string> #include <string>
#include <string_view>
#include <list> #include <list>
class SimpleDatabase; class SimpleDatabase;
...@@ -40,7 +41,7 @@ struct UpdateQueueItem { ...@@ -40,7 +41,7 @@ struct UpdateQueueItem {
UpdateQueueItem(SimpleDatabase &_db, UpdateQueueItem(SimpleDatabase &_db,
Storage &_storage, Storage &_storage,
const char *_path, bool _discard, std::string_view _path, bool _discard,
unsigned _id) noexcept unsigned _id) noexcept
:db(&_db), storage(&_storage), path_utf8(_path), :db(&_db), storage(&_storage), path_utf8(_path),
id(_id), discard(_discard) {} id(_id), discard(_discard) {}
...@@ -62,7 +63,7 @@ class UpdateQueue { ...@@ -62,7 +63,7 @@ class UpdateQueue {
public: public:
gcc_nonnull_all gcc_nonnull_all
bool Push(SimpleDatabase &db, Storage &storage, bool Push(SimpleDatabase &db, Storage &storage,
const char *path, bool discard, unsigned id) noexcept; std::string_view path, bool discard, unsigned id) noexcept;
UpdateQueueItem Pop() noexcept; UpdateQueueItem Pop() noexcept;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment