diff options
Diffstat (limited to 'absl/strings/cordz_test_helpers.h')
-rw-r--r-- | absl/strings/cordz_test_helpers.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/absl/strings/cordz_test_helpers.h b/absl/strings/cordz_test_helpers.h index e410eecf..619f13c2 100644 --- a/absl/strings/cordz_test_helpers.h +++ b/absl/strings/cordz_test_helpers.h @@ -21,6 +21,7 @@ #include "gtest/gtest.h" #include "absl/base/config.h" #include "absl/base/macros.h" +#include "absl/base/nullability.h" #include "absl/strings/cord.h" #include "absl/strings/internal/cord_internal.h" #include "absl/strings/internal/cordz_info.h" @@ -33,15 +34,16 @@ namespace absl { ABSL_NAMESPACE_BEGIN // Returns the CordzInfo for the cord, or nullptr if the cord is not sampled. -inline const cord_internal::CordzInfo* GetCordzInfoForTesting( +inline absl::Nullable<const cord_internal::CordzInfo*> GetCordzInfoForTesting( const Cord& cord) { if (!cord.contents_.is_tree()) return nullptr; return cord.contents_.cordz_info(); } // Returns true if the provided cordz_info is in the list of sampled cords. -inline bool CordzInfoIsListed(const cord_internal::CordzInfo* cordz_info, - cord_internal::CordzSampleToken token = {}) { +inline bool CordzInfoIsListed( + absl::Nonnull<const cord_internal::CordzInfo*> cordz_info, + cord_internal::CordzSampleToken token = {}) { for (const cord_internal::CordzInfo& info : token) { if (cordz_info == &info) return true; } @@ -119,7 +121,7 @@ class CordzSamplingIntervalHelper { // Wrapper struct managing a small CordRep `rep` struct TestCordRep { - cord_internal::CordRepFlat* rep; + absl::Nonnull<cord_internal::CordRepFlat*> rep; TestCordRep() { rep = cord_internal::CordRepFlat::New(100); |