File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/main/java/com/shuzijun/leetcode/plugin/manager Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -313,6 +313,7 @@ private static void questionOfToday() {
313
313
QuestionManager .dayQuestion = null ;
314
314
} else {
315
315
QuestionManager .dayQuestion = JSONObject .parseObject (response .getBody ()).getJSONObject ("data" ).getJSONArray ("todayRecord" ).getJSONObject (0 ).getJSONObject ("question" ).getString ("questionFrontendId" );
316
+ return ;
316
317
}
317
318
} catch (Exception e1 ) {
318
319
}
@@ -411,18 +412,16 @@ public QuestionComparator(Sort sort) {
411
412
412
413
@ Override
413
414
public int compare (Question o1 , Question o2 ) {
414
- if (o1 .equals (dayQuestion )) {
415
+ if (o1 .getFrontendQuestionId (). equals (dayQuestion )) {
415
416
return -1 ;
417
+ } else if (o2 .getFrontendQuestionId ().equals (dayQuestion )) {
418
+ return 1 ;
416
419
}
417
420
int order = 0 ;
418
421
if (Constant .SORT_TYPE_ID .equals (sort .getSlug ())) {
419
422
String frontendId0 = o1 .getFrontendQuestionId ();
420
423
String frontendId1 = o2 .getFrontendQuestionId ();
421
- if (frontendId0 .equals (dayQuestion )) {
422
- return -1 ;
423
- } else if (frontendId1 .equals (dayQuestion )) {
424
- order = 1 ;
425
- } else if (StringUtils .isNumeric (frontendId0 ) && StringUtils .isNumeric (frontendId1 )) {
424
+ if (StringUtils .isNumeric (frontendId0 ) && StringUtils .isNumeric (frontendId1 )) {
426
425
order = Integer .valueOf (frontendId0 ).compareTo (Integer .valueOf (frontendId1 ));
427
426
} else if (StringUtils .isNumeric (frontendId0 )) {
428
427
order = -1 ;
You can’t perform that action at this time.
0 commit comments