diff --git a/src/Completion.cxx b/src/Completion.cxx index 25102fa8..65c62c56 100644 --- a/src/Completion.cxx +++ b/src/Completion.cxx @@ -6,7 +6,7 @@ #include Completion::Result -Completion::Complete(const std::string &prefix) const noexcept +Completion::Complete(const std::string_view prefix) const noexcept { auto lower = list.lower_bound(prefix); if (lower == list.end() || !lower->starts_with(prefix)) diff --git a/src/Completion.hxx b/src/Completion.hxx index 47976812..73fb7059 100644 --- a/src/Completion.hxx +++ b/src/Completion.hxx @@ -59,7 +59,7 @@ public: Range range; }; - Result Complete(const std::string &prefix) const noexcept; + Result Complete(std::string_view prefix) const noexcept; virtual void Pre(std::string_view value) noexcept = 0; virtual void Post(std::string_view value, Range range) noexcept = 0;