Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::numeric_limits<> #9954

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix
  • Loading branch information
siying committed May 5, 2022
commit c3a39cbeafbc6755042909846dc6ab5aa7225d15
4 changes: 1 addition & 3 deletions db/file_indexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ class FileIndexer {
void UpdateIndex(Arena* arena, const size_t num_levels,
std::vector<FileMetaData*>* const files);

enum {
kLevelMaxIndex = std::numeric_limits<int32_t>::max()
};
enum { kLevelMaxIndex = std::numeric_limits<int32_t>::max() };

private:
size_t num_levels_;
Expand Down
4 changes: 2 additions & 2 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2029,11 +2029,11 @@ void StressTest::TestAcquireSnapshot(ThreadState* thread,
if (FLAGS_long_running_snapshots) {
// Hold 10% of snapshots for 10x more
if (thread->rand.OneIn(10)) {
assert(hold_for < std::numeric_limits<int64_t>::max() / 10);
assert(hold_for < std::numeric_limits<uint64_t>::max() / 10);
hold_for *= 10;
// Hold 1% of snapshots for 100x more
if (thread->rand.OneIn(10)) {
assert(hold_for < std::numeric_limits<int64_t>::max() / 10);
assert(hold_for < std::numeric_limits<uint64_t>::max() / 10);
hold_for *= 10;
}
}
Expand Down