================
@@ -1746,16 +1746,13 @@ void Preprocessor::removePPCallbacks() {
 const char *Preprocessor::getCheckPoint(FileID FID, const char *Start) const {
   if (auto It = CheckPoints.find(FID); It != CheckPoints.end()) {
     const SmallVector<const char *> &FileCheckPoints = It->second;
-    const char *Last = nullptr;
-    // FIXME: Do better than a linear search.
-    for (const char *P : FileCheckPoints) {
-      if (P > Start)
-        break;
-      Last = P;
+    auto P =
+        std::upper_bound(FileCheckPoints.begin(), FileCheckPoints.end(), 
Start);
----------------
tbaederr wrote:

```suggestion
        llvm::upper_bound(FileCheckPoints, Start);
```

https://github.com/llvm/llvm-project/pull/206356
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to