Rearrange error_code::failed to improve codegen

This commit is contained in:
Peter Dimov
2021-09-15 16:42:47 +03:00
parent a65b91b3fb
commit 3b70265ced

View File

@ -230,18 +230,20 @@ public:
BOOST_SYSTEM_CONSTEXPR bool failed() const BOOST_NOEXCEPT
{
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
if( lc_flags_ == 1 )
if( lc_flags_ & 1 )
{
std::error_code const& ec = *reinterpret_cast<std::error_code const*>( d2_ );
return ec.value() != 0;
#if defined(BOOST_SYSTEM_HAS_SYSTEM_ERROR)
if( lc_flags_ == 1 )
{
std::error_code const& ec = *reinterpret_cast<std::error_code const*>( d2_ );
return ec.value() != 0;
}
#endif
return true;
}
else
#endif
{
return (lc_flags_ & 1) != 0;
return false;
}
}