From 9257dbee1bc604fffaf2f74e3063f57deaa148bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=BF=90=E6=9D=A5?= Date: Mon, 15 Jan 2024 21:15:55 +0800 Subject: [PATCH] clang-format --- benchmark/record_manager_concurrency_test.cpp | 1 - deps/common/log/log.h | 9 ++++----- deps/common/math/integer_generator.h | 8 ++------ unittest/integer_generator_test.cpp | 4 ++-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/benchmark/record_manager_concurrency_test.cpp b/benchmark/record_manager_concurrency_test.cpp index 8f470f179..5ae256d72 100644 --- a/benchmark/record_manager_concurrency_test.cpp +++ b/benchmark/record_manager_concurrency_test.cpp @@ -282,7 +282,6 @@ BENCHMARK_DEFINE_F(DeletionBenchmark, Deletion)(State &state) IntegerGenerator generator(0, static_cast(rids_.size() - 1)); Stat stat; - for (auto _ : state) { int32_t value = generator.next(); RID rid = rids_[value]; diff --git a/deps/common/log/log.h b/deps/common/log/log.h index 2063712da..0c98dac2e 100644 --- a/deps/common/log/log.h +++ b/deps/common/log/log.h @@ -335,13 +335,12 @@ int Log::out(const LOG_LEVEL console_level, const LOG_LEVEL log_level, T &msg) #ifndef TRACE #ifdef DEBUG -#define TRACE(format, ...) \ - LOG_TRACE(format, ##__VA_ARGS__) -#else // DEBUG +#define TRACE(format, ...) LOG_TRACE(format, ##__VA_ARGS__) +#else // DEBUG #define TRACE(...) -#endif // DEBUG +#endif // DEBUG -#endif // TRACE +#endif // TRACE #define SYS_OUTPUT_FILE_POS ", File:" << __FILE__ << ", line:" << __LINE__ << ",function:" << __FUNCTION__ #define SYS_OUTPUT_ERROR ",error:" << errno << ":" << strerror(errno) diff --git a/deps/common/math/integer_generator.h b/deps/common/math/integer_generator.h index 8c9296ef3..dc625be1f 100644 --- a/deps/common/math/integer_generator.h +++ b/deps/common/math/integer_generator.h @@ -15,17 +15,13 @@ See the Mulan PSL v2 for more details. */ #pragma once #include -#include "common/log/log.h" namespace common { class IntegerGenerator { public: - IntegerGenerator() = delete; - IntegerGenerator(int min, int max) : distrib_(min, max) { - LOG_INFO("IntegerGenerator: min=%d, max=%d", distrib_.min(), distrib_.max()); - } + IntegerGenerator(int min, int max) : distrib_(min, max) {} IntegerGenerator(const IntegerGenerator &other) = delete; IntegerGenerator &operator=(const IntegerGenerator &) = delete; @@ -39,4 +35,4 @@ class IntegerGenerator std::uniform_int_distribution<> distrib_; }; -} // namespace common +} // namespace common diff --git a/unittest/integer_generator_test.cpp b/unittest/integer_generator_test.cpp index 69d689b19..e88993431 100644 --- a/unittest/integer_generator_test.cpp +++ b/unittest/integer_generator_test.cpp @@ -20,8 +20,8 @@ using namespace common; TEST(IntegerGenerator, test) { - const int min = 1; - const int max = 120000; + const int min = 1; + const int max = 120000; IntegerGenerator generator(min, max); for (int i = 0; i < 1000000; i++) { int value = generator.next();