From e58cc56fb50ce9389445169da913b88045a557d5 Mon Sep 17 00:00:00 2001 From: anand76 Date: Fri, 28 Jan 2022 12:47:42 -0800 Subject: [PATCH] Use == operator for shared_ptr nullptr comparison (#9465) Summary: From C++ 20 onwards, the != operator is not supported for a shared_ptr. So switch to using ==. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9465 Test Plan: make check Reviewed By: riversand963 Differential Revision: D33850596 Pulled By: anand1976 fbshipit-source-id: eec16d1aa6c39a315ec2d44d233d7518f9c1ddcb --- include/rocksdb/utilities/object_registry.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rocksdb/utilities/object_registry.h b/include/rocksdb/utilities/object_registry.h index 05e438bcd..928676b2e 100644 --- a/include/rocksdb/utilities/object_registry.h +++ b/include/rocksdb/utilities/object_registry.h @@ -531,10 +531,10 @@ class ObjectRegistry { } } } - if (parent_ != nullptr) { - return parent_->FindFactory(name); - } else { + if (parent_ == nullptr) { return nullptr; + } else { + return parent_->FindFactory(name); } }