[clang-tools-extra] [clang-doc][NFC] Avoid else after return (PR #136389)

via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 18 17:34:23 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tools-extra

Author: Paul Kirth (ilovepi)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/136389.diff


1 Files Affected:

- (modified) clang-tools-extra/clang-doc/BitcodeReader.cpp (+2-3) 


``````````diff
diff --git a/clang-tools-extra/clang-doc/BitcodeReader.cpp b/clang-tools-extra/clang-doc/BitcodeReader.cpp
index 1f2fb0a8b2b85..dba5fcbeb062e 100644
--- a/clang-tools-extra/clang-doc/BitcodeReader.cpp
+++ b/clang-tools-extra/clang-doc/BitcodeReader.cpp
@@ -874,7 +874,7 @@ llvm::Error ClangDocBitcodeReader::validateStream() {
     Expected<llvm::SimpleBitstreamCursor::word_t> MaybeRead = Stream.Read(8);
     if (!MaybeRead)
       return MaybeRead.takeError();
-    else if (MaybeRead.get() != BitCodeConstants::Signature[Idx])
+    if (MaybeRead.get() != BitCodeConstants::Signature[Idx])
       return llvm::createStringError(llvm::inconvertibleErrorCode(),
                                      "invalid bitcode signature");
   }
@@ -886,8 +886,7 @@ llvm::Error ClangDocBitcodeReader::readBlockInfoBlock() {
       Stream.ReadBlockInfoBlock();
   if (!MaybeBlockInfo)
     return MaybeBlockInfo.takeError();
-  else
-    BlockInfo = MaybeBlockInfo.get();
+  BlockInfo = MaybeBlockInfo.get();
   if (!BlockInfo)
     return llvm::createStringError(llvm::inconvertibleErrorCode(),
                                    "unable to parse BlockInfoBlock");

``````````

</details>


https://github.com/llvm/llvm-project/pull/136389


More information about the cfe-commits mailing list