aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-05-16 01:18:27 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-05-16 01:18:27 +0300
commit23aa1a5c37677a38873dc627f4b8077e0390f420 (patch)
treed615fc41d034b1ca27173f7c25b767866439b1c1 /src
parentFile: make public child of Handle (diff)
downloadwinapi-common-23aa1a5c37677a38873dc627f4b8077e0390f420.tar.gz
winapi-common-23aa1a5c37677a38873dc627f4b8077e0390f420.zip
Handle: is_invalid -> is_valid
Diffstat (limited to 'src')
-rw-r--r--src/handle.cpp10
1 files changed, 5 insertions, 5 deletions
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);