From 23aa1a5c37677a38873dc627f4b8077e0390f420 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 16 May 2021 01:18:27 +0300 Subject: Handle: is_invalid -> is_valid --- src/handle.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/handle.cpp b/src/handle.cpp index ba1e4b5..66f878f 100644 --- a/src/handle.cpp +++ b/src/handle.cpp @@ -52,12 +52,12 @@ void Handle::swap(Handle& other) BOOST_NOEXCEPT_OR_NOTHROW { swap(m_impl, other.m_impl); } -bool Handle::is_invalid() const { - return !m_impl || is_invalid(m_impl.get()); +bool Handle::is_valid() const { + return m_impl && is_valid(m_impl.get()); } -bool Handle::is_invalid(HANDLE handle) { - return handle == NULL || handle == INVALID_HANDLE_VALUE; +bool Handle::is_valid(HANDLE handle) { + return handle != NULL && handle != INVALID_HANDLE_VALUE; } void Handle::close() { @@ -149,7 +149,7 @@ void Handle::inherit(bool yes) const { } void Handle::Close::operator()(HANDLE impl) const { - if (is_invalid(impl) || is_std_handle(impl)) + if (!is_valid(impl) || is_std_handle(impl)) return; const auto ret = ::CloseHandle(impl); assert(ret); -- cgit v1.2.3