mapleFU commented on code in PR #2262:
URL: https://github.com/apache/kvrocks/pull/2262#discussion_r1574177989
##########
src/storage/redis_db.h:
##########
@@ -23,13 +23,33 @@
#include <map>
#include <string>
#include <utility>
+#include <variant>
#include <vector>
#include "redis_metadata.h"
+#include "server/redis_reply.h"
#include "storage.h"
namespace redis {
+struct SortArgument {
+ std::string sortby; // BY
+ bool dontsort = false; // DONT SORT
+ int offset = 0; // LIMIT OFFSET
+ int count = -1; // LIMIT COUNT
+ std::vector<std::string> getpatterns; // GET
+ bool desc = false; // ASC/DESC
+ bool alpha = false; // ALPHA
+ std::string storekey; // STORE
+};
+
+struct RedisSortObject {
+ std::string obj;
+ std::variant<double, std::string> v;
+};
+
+bool SortCompare(const RedisSortObject &a, const RedisSortObject &b, const
SortArgument &args);
Review Comment:
What does the bool return value in "SortCompare" means? Would you mind add a
doc string or change the function name?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]