1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00

LanguageServers/Cpp: Make token_in_position() return a StringView

This avoids a whole bunch of string allocation churn.
This commit is contained in:
Andreas Kling 2020-10-29 22:49:14 +01:00
parent aaf4ec62cf
commit d28127c807
2 changed files with 6 additions and 5 deletions

View file

@ -45,7 +45,7 @@ public:
private:
static Optional<size_t> token_in_position(const Vector<Cpp::Token>&, const GUI::TextPosition&);
static String text_of_token(const Vector<String>& lines, const Cpp::Token&);
static StringView text_of_token(const Vector<String>& lines, const Cpp::Token&);
static Vector<AutoCompleteResponse> identifier_prefixes(const Vector<String>& lines, const Vector<Cpp::Token>&, size_t target_token_index);
};