From 98a3b8cf6531220c5ecfe124ebfe7d29deb1251b Mon Sep 17 00:00:00 2001 From: leveldb Team Date: Fri, 17 Apr 2020 21:19:50 +0000 Subject: [PATCH] change const to constexpr PiperOrigin-RevId: 307113877 --- db/skiplist_test.cc | 3 +-- util/cache_test.cc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/db/skiplist_test.cc b/db/skiplist_test.cc index 7c5d09b..9c70c5b 100644 --- a/db/skiplist_test.cc +++ b/db/skiplist_test.cc @@ -151,7 +151,7 @@ TEST(SkipTest, InsertAndLookup) { // been concurrently added since the iterator started. class ConcurrentTest { private: - static const uint32_t K = 4; + static constexpr uint32_t K = 4; static uint64_t key(Key key) { return (key >> 40); } static uint64_t gen(Key key) { return (key >> 8) & 0xffffffffu; } @@ -280,7 +280,6 @@ class ConcurrentTest { } } }; -const uint32_t ConcurrentTest::K; // Simple test that does single-threaded testing of the ConcurrentTest // scaffolding. diff --git a/util/cache_test.cc b/util/cache_test.cc index b5d9873..79cfc27 100644 --- a/util/cache_test.cc +++ b/util/cache_test.cc @@ -31,7 +31,7 @@ class CacheTest : public testing::Test { current_->deleted_values_.push_back(DecodeValue(v)); } - static const int kCacheSize = 1000; + static constexpr int kCacheSize = 1000; std::vector deleted_keys_; std::vector deleted_values_; Cache* cache_;