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

Tidy files inside src/commands #1137

Merged
merged 1 commit into from
Nov 25, 2022
Merged

Conversation

torwig
Copy link
Contributor

@torwig torwig commented Nov 24, 2022

Edit files according to clang-tidy tips.
Found a few places with missed return keywords.
Fixed some typos.
Inserted blank lines to break the code into logical blocks.
Use size_t in for loops.
Uninitialized variables were initialized.
Condition statements if (a == nullptr) and if (a != nullptr) were replaced with if (!a) and if (a) respectively.
The occurrences of rocksdb::Status were replaced with auto.

Narrowing conversions were left untouched for now.

P.S. Diff is really big because the file src/commands/redis_cmd.cc is big by itself.

Edit files according to clang-tidy tips.
Narrowing conversion were left untouched.

if (*ttl_ms <= 0) return {Status::RedisParseErr, errInvalidExpireTime};

if (*ttl_ms < 1000) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the condition *ttl_ms <= 0 was checked a few lines before, here we can omit the *ttl_ms > 0 check.

Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. So many lines to review 🤣

@git-hulk
Copy link
Member

Thanks all, merging...

@git-hulk git-hulk merged commit 272c9ef into apache:unstable Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants