Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Chiro11 committed Apr 5, 2024
1 parent a7c4c38 commit 6984cbc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/commands/cmd_key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CommandMove : public Commander {
} else if (args.size() == 4) {
move_type_ = MoveType::kNormal;
} else {
return Status(Status::RedisParseErr, errWrongNumOfArguments);
return {Status::RedisParseErr, errWrongNumOfArguments};
}
return Status::OK();
}
Expand Down
6 changes: 3 additions & 3 deletions src/storage/redis_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ rocksdb::Status Database::Rename(const std::string &key, const std::string &new_

if (key == new_key) return rocksdb::Status::OK();

return MoveInternal(ns_key, new_ns_key, type);
return moveInternal(ns_key, new_ns_key, type);
}

rocksdb::Status Database::Move(const std::string &key, const std::string &new_ns, bool *ret) {
Expand Down Expand Up @@ -762,10 +762,10 @@ rocksdb::Status Database::Move(const std::string &key, const std::string &new_ns
}
}

return MoveInternal(ns_key, new_ns_key, type);
return moveInternal(ns_key, new_ns_key, type);
}

rocksdb::Status Database::MoveInternal(const std::string &ns_key, const std::string &new_ns_key, RedisType type) {
rocksdb::Status Database::moveInternal(const std::string &ns_key, const std::string &new_ns_key, RedisType type) {
auto batch = storage_->GetWriteBatchBase();
WriteBatchLogData log_data(type);
batch->PutLogData(log_data.Encode());
Expand Down
2 changes: 1 addition & 1 deletion src/storage/redis_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Database {
[[nodiscard]] rocksdb::Status Move(const std::string &key, const std::string &new_ns, bool *ret);

protected:
[[nodiscard]] rocksdb::Status MoveInternal(const std::string &ns_key, const std::string &new_ns_key, RedisType type);
[[nodiscard]] rocksdb::Status moveInternal(const std::string &ns_key, const std::string &new_ns_key, RedisType type);

engine::Storage *storage_;
rocksdb::ColumnFamilyHandle *metadata_cf_handle_;
Expand Down
2 changes: 1 addition & 1 deletion tests/gocase/unit/move/move_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestMove(t *testing.T) {
require.NoError(t, rdb.Do(ctx, "AUTH", "token1").Err())
require.EqualValues(t, "value1", rdb.Get(ctx, "key1").Val())
require.NoError(t, rdb.Do(ctx, "AUTH", password).Err())

// move key2 to ns2, with wrong token first
r = rdb.Do(ctx, "MOVE", "key2", "ns2", "token1")
require.EqualError(t, r.Err(), "ERR Incorrect namespace or token")
Expand Down

0 comments on commit 6984cbc

Please sign in to comment.