[libcxx-commits] [libcxx] b5a6e8a - [NFC][libc++] Rewrites a return statement.

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 9 06:52:20 PST 2023


Author: Mark de Wever
Date: 2023-12-09T15:50:18+01:00
New Revision: b5a6e8a433e9ecc0e3a05fc428d515f3a12413cf

URL: https://github.com/llvm/llvm-project/commit/b5a6e8a433e9ecc0e3a05fc428d515f3a12413cf
DIFF: https://github.com/llvm/llvm-project/commit/b5a6e8a433e9ecc0e3a05fc428d515f3a12413cf.diff

LOG: [NFC][libc++] Rewrites a return statement.

This fixes a clang-tidy diagnostic when building libc++ with RTTI
disabled. This was originally part of #65518.

Added: 
    

Modified: 
    libcxx/include/any

Removed: 
    


################################################################################
diff  --git a/libcxx/include/any b/libcxx/include/any
index 516fd6ddb23cc4..7dcffc46a60d55 100644
--- a/libcxx/include/any
+++ b/libcxx/include/any
@@ -194,9 +194,7 @@ namespace __any_imp
       if (__id && *__id == typeid(_Tp))
           return true;
 #endif
-      if (!__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>())
-          return true;
-      return false;
+      return !__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>();
   }
 
   template <class _Tp>


        


More information about the libcxx-commits mailing list