Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: add sort commands #357
feat: add sort commands #357
Changes from 13 commits
08ce98c
106a216
a08635d
1349df0
c0f59f9
cd274a9
9b9dc71
748d795
f6a753a
f086ab3
bbe6624
b064f70
990d4bd
789bbac
ea46866
af9a8ce
ccbf94c
648c6bd
a01c008
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
293行到324行的代码主要是做命令行的解析,挪到doinitial会不会好一些
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zset本身具有有序性,再进行排序会不会不合适
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我看sort 命令支持zset数据类型 应该是想通过关联其他数据进行排序,就是by后面的pattern。例如:sort myzset by user*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有道理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要是获取数据失败了怎么办,这里可以根据status加一个错误处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,感谢,我再修改一下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
方法
SortCmd::DoCmd
实现复杂,建议重构。该方法实现了
sort
命令的核心功能,包括解析命令参数和执行排序操作。代码较长且包含多个分支,建议将其拆分成更小的函数,以提高代码的可读性和可维护性。