From e81dc2a725ad6326477a594bd8e923eae19cfd19 Mon Sep 17 00:00:00 2001 From: Menci Date: Fri, 19 Apr 2019 11:24:07 +0800 Subject: [PATCH] Remove unnecessary assignments --- modules/problem.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/problem.js b/modules/problem.js index 168b4ad..7b2c31c 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -30,9 +30,9 @@ app.get('/problems', async (req, res) => { } if (sort === 'ac_rate') { - query = query.orderBy('ac_num / submit_num', order.toUpperCase()); + query.orderBy('ac_num / submit_num', order.toUpperCase()); } else { - query = query.orderBy(sort, order.toUpperCase()); + query.orderBy(sort, order.toUpperCase()); } let paginate = syzoj.utils.paginate(await Problem.countQuery(query), req.query.page, syzoj.config.page.problem); @@ -93,9 +93,9 @@ app.get('/problems/search', async (req, res) => { query.orderBy('id = ' + id.toString(), 'DESC'); if (sort === 'ac_rate') { - query = query.addOrderBy('ac_num / submit_num', order.toUpperCase()); + query.addOrderBy('ac_num / submit_num', order.toUpperCase()); } else { - query = query.addOrderBy(sort, order.toUpperCase()); + query.addOrderBy(sort, order.toUpperCase()); } let paginate = syzoj.utils.paginate(await Problem.countQuery(query), req.query.page, syzoj.config.page.problem);