Skip to content

Commit

Permalink
Completion: pass std::string_view to Complete()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Sep 11, 2024
1 parent 58cfb5b commit e834fb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Completion.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <assert.h>

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))
Expand Down
2 changes: 1 addition & 1 deletion src/Completion.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e834fb2

Please sign in to comment.