Compare explicitly against nullptr.

Follow-up to 6f0fbad.

PiperOrigin-RevId: 729438488
This commit is contained in:
Tomoki Nakagawa
2025-02-21 09:57:04 +00:00
committed by Hiroyuki Komatsu
parent 09d9351a96
commit ce468cff76

View File

@ -112,7 +112,8 @@ template <class Interface, class Impl>
class SingletonMockable {
public:
static Interface *Get() {
if (Interface *mock = mock_.load(std::memory_order_acquire)) {
if (Interface *mock = mock_.load(std::memory_order_acquire);
mock != nullptr) {
return mock;
}
static absl::NoDestructor<Impl> impl;