Skip to content

Commit 2da4e26

Browse files
committed
refactor: delete unnecessary variable definitions and optimize the semantics of comments
1 parent e3a15e1 commit 2da4e26

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/pika_list.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,8 @@ void RPopCmd::DoInitial() {
270270
return;
271271
}
272272
key_ = argv_[1];
273-
size_t argc = argv_.size();
274273
size_t index = 2;
275-
if (index < argc) {
274+
if (index < argv_.size()) {
276275
if (pstd::string2int(argv_[index].data(), argv_[index].size(), &count_) == 0) {
277276
res_.SetRes(CmdRes::kWrongNum, kCmdNameRPop);
278277
return;

src/storage/include/storage/storage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,10 +498,10 @@ class Storage {
498498
// the value stored at key is not a list.
499499
Status LLen(const Slice& key, uint64_t* len);
500500

501-
// Removes and returns the left elements of the list stored at key.
501+
// Removes and returns the first elements of the list stored at key.
502502
Status LPop(const Slice& key, int64_t count, std::vector<std::string>* elements);
503503

504-
// Removes and returns the right elements of the list stored at key.
504+
// Removes and returns the last elements of the list stored at key.
505505
Status RPop(const Slice& key, int64_t count, std::vector<std::string>* elements);
506506

507507
// Returns the element at index index in the list stored at key. The index is

0 commit comments

Comments
 (0)