forked from OSchip/llvm-project
[clangd] Fix broken helper deep in unit test. NFC
llvm-svn: 359112
This commit is contained in:
parent
55f14dac74
commit
c60a4099a1
|
@ -29,15 +29,9 @@ Symbol symbol(llvm::StringRef QName) {
|
|||
|
||||
static std::string replace(llvm::StringRef Haystack, llvm::StringRef Needle,
|
||||
llvm::StringRef Repl) {
|
||||
std::string Result;
|
||||
llvm::raw_string_ostream OS(Result);
|
||||
std::pair<llvm::StringRef, llvm::StringRef> Split;
|
||||
for (Split = Haystack.split(Needle); !Split.second.empty();
|
||||
Split = Split.first.split(Needle))
|
||||
OS << Split.first << Repl;
|
||||
Result += Split.first;
|
||||
OS.flush();
|
||||
return Result;
|
||||
llvm::SmallVector<llvm::StringRef, 8> Parts;
|
||||
Haystack.split(Parts, Needle);
|
||||
return llvm::join(Parts, Repl);
|
||||
}
|
||||
|
||||
// Helpers to produce fake index symbols for memIndex() or completions().
|
||||
|
|
Loading…
Reference in New Issue