8000 Fixes sorting in list command. · liaoziyang/leetcode-cli@797708c · GitHub
[go: up one dir, main page]

Skip to content

Commit 797708c

Browse files
committed
Fixes sorting in list command.
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent bbdb4dc commit 797708c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/commands/list.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ cmd.handler = function(argv) {
111111
stat[x] = 0;
112112
});
113113

114+
problems = _.sortBy(problems, function(x) {
115+
return -x.id;
116+
});
117+
114118
problems.forEach(function(problem) {
115119
stat[problem.level] = (stat[problem.level] || 0) + 1;
116120
stat[problem.state] = (stat[problem.state] || 0) + 1;

0 commit comments

Comments
 (0)
0