We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 721e3e9 + fd5c56e commit edbee9eCopy full SHA for edbee9e
lib/IDE/REPLCodeCompletion.cpp
@@ -315,12 +315,17 @@ StringRef REPLCompletions::getRoot() const {
315
316
std::string RootStr = CookedResults[0].InsertableString.str();
317
for (auto R : CookedResults) {
318
+ if (RootStr.empty())
319
+ break;
320
+
321
if (R.NumBytesToErase != 0) {
322
RootStr.resize(0);
323
break;
324
}
- auto MismatchPlace = std::mismatch(RootStr.begin(), RootStr.end(),
- R.InsertableString.begin());
325
326
+ auto MismatchPlace =
327
+ std::mismatch(RootStr.begin(), RootStr.end(),
328
+ R.InsertableString.begin(), R.InsertableString.end());
329
RootStr.resize(MismatchPlace.first - RootStr.begin());
330
331
Root = RootStr;
0 commit comments