diff options
| author | babenko <[email protected]> | 2026-04-27 15:52:34 +0300 |
|---|---|---|
| committer | babenko <[email protected]> | 2026-04-27 16:12:31 +0300 |
| commit | b36733c26de293fbc1562234f05ce2b41f7251a2 (patch) | |
| tree | 1886d2d1ed7c6ef96ab621099fc5691d69b11dfe /library/cpp/yt | |
| parent | 53762a5d5d815a553f9a3a83ecdd94951e429c18 (diff) | |
Use implicit bool conversion for null check in origin_attributes.cpp
commit_hash:cc1f5b9ecc05f6b098f1645ba338fc644c0bb53f
Diffstat (limited to 'library/cpp/yt')
| -rw-r--r-- | library/cpp/yt/containers/sentinel_optional-inl.h | 2 | ||||
| -rw-r--r-- | library/cpp/yt/error/origin_attributes.cpp | 2 | ||||
| -rw-r--r-- | library/cpp/yt/error/unittests/error_ut.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/library/cpp/yt/containers/sentinel_optional-inl.h b/library/cpp/yt/containers/sentinel_optional-inl.h index c16f843f8a6..a5676afa7f3 100644 --- a/library/cpp/yt/containers/sentinel_optional-inl.h +++ b/library/cpp/yt/containers/sentinel_optional-inl.h @@ -22,7 +22,7 @@ constexpr TSentinelOptional<T, TSentinel>::TSentinelOptional(T value) noexcept template <class T, class TSentinel> constexpr TSentinelOptional<T, TSentinel>::TSentinelOptional(std::optional<T> opt) noexcept - : Value_(opt.has_value() ? *opt : TSentinel::Sentinel) + : Value_(opt ? *opt : TSentinel::Sentinel) { } template <class T, class TSentinel> diff --git a/library/cpp/yt/error/origin_attributes.cpp b/library/cpp/yt/error/origin_attributes.cpp index e538670c73f..18582bf3e83 100644 --- a/library/cpp/yt/error/origin_attributes.cpp +++ b/library/cpp/yt/error/origin_attributes.cpp @@ -135,7 +135,7 @@ TOriginAttributes ExtractFromDictionary(TErrorAttributes* attributes) TOriginAttributes ExtractFromDictionaryDefault(TErrorAttributes* attributes) { TOriginAttributes result; - if (attributes == nullptr) { + if (!attributes) { return result; } diff --git a/library/cpp/yt/error/unittests/error_ut.cpp b/library/cpp/yt/error/unittests/error_ut.cpp index ba2f1ebeddd..e7cbbcd21d8 100644 --- a/library/cpp/yt/error/unittests/error_ut.cpp +++ b/library/cpp/yt/error/unittests/error_ut.cpp @@ -658,7 +658,7 @@ TEST(TErrorTest, TruncateWhitelistSaveInnerError) EXPECT_EQ(error.InnerErrors()[0], whitelistedInner); EXPECT_EQ(error.InnerErrors()[1], genericInner); - // TODO: error_helpers??? + // TODO(arkady-e1ppa): error_helpers??? EXPECT_TRUE(FindAttributeRecursive<int>(error, "whitelisted_key")); EXPECT_FALSE(FindAttributeRecursive<int>(error, "foo")); } |
