Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
hnwyllmm committed Jan 15, 2024
1 parent 4878ee2 commit 9257dbe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion benchmark/record_manager_concurrency_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ BENCHMARK_DEFINE_F(DeletionBenchmark, Deletion)(State &state)
IntegerGenerator generator(0, static_cast<int>(rids_.size() - 1));
Stat stat;


for (auto _ : state) {
int32_t value = generator.next();
RID rid = rids_[value];
Expand Down
9 changes: 4 additions & 5 deletions deps/common/log/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 2 additions & 6 deletions deps/common/math/integer_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,13 @@ See the Mulan PSL v2 for more details. */
#pragma once

#include <random>
#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;
Expand All @@ -39,4 +35,4 @@ class IntegerGenerator
std::uniform_int_distribution<> distrib_;
};

} // namespace common
} // namespace common
4 changes: 2 additions & 2 deletions unittest/integer_generator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9257dbe

Please sign in to comment.