[PATCH] D155614: [clangd] Remove redundant emptiness check in cross ref calculation for includes.

Viktoriia Bakalova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 01:29:38 PDT 2023


VitaNuo updated this revision to Diff 541882.
VitaNuo marked 2 inline comments as done.
VitaNuo added a comment.

Remove only one of the checks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155614/new/

https://reviews.llvm.org/D155614

Files:
  clang-tools-extra/clangd/XRefs.cpp


Index: clang-tools-extra/clangd/XRefs.cpp
===================================================================
--- clang-tools-extra/clangd/XRefs.cpp
+++ clang-tools-extra/clangd/XRefs.cpp
@@ -1367,9 +1367,6 @@
       rangeTillEOL(SM.getBufferData(SM.getMainFileID()), Inc.HashOffset);
   Result.Loc.uri = URIMainFile;
   Results.References.push_back(std::move(Result));
-
-  if (Results.References.empty())
-    return std::nullopt;
   return Results;
 }
 } // namespace


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155614.541882.patch
Type: text/x-patch
Size: 471 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230719/42fcf57a/attachment-0001.bin>


More information about the cfe-commits mailing list