Skip to content

Commit 2b5941c

Browse files
refactor: using bool value instead of 0/1
1 parent ed75788 commit 2b5941c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

makespec/BUILDVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
199
1+
200

src/core/judgingcontroller.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define LEMON_MODULE_NAME "JudgingController"
1414

1515
JudgingController::JudgingController(Settings *settings, QObject *parent) : QObject(parent) {
16-
isJudging = 0;
16+
isJudging = false;
1717
maxThreads = qMax(1, settings->getMaxJudgingThreads());
1818
}
1919

@@ -57,15 +57,15 @@ void JudgingController::start() {
5757
emit judgeFinished();
5858
return;
5959
}
60-
isJudging = 1;
60+
isJudging = true;
6161
while (! queuingTasks.empty() && runningTasks.size() < maxThreads) {
6262
assign();
6363
}
6464
}
6565
void JudgingController::stop() {
6666
if (! isJudging)
6767
return;
68-
isJudging = 0;
68+
isJudging = false;
6969
for (auto [taskJudger, thread] : runningTasks.toStdMap()) {
7070
QMetaObject::invokeMethod(taskJudger, &TaskJudger::stop);
7171
}

src/core/taskjudger.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void TaskJudger::judgeIt() {
354354
}
355355

356356
int TaskJudger::judge() {
357-
isJudging = 1;
357+
isJudging = true;
358358
QString contestantName = contestant->getContestantName();
359359
if (! temporaryDir.isValid())
360360
return 0;
@@ -540,4 +540,4 @@ void TaskJudger::taskSkipped(const std::pair<int, int> &cur) {
540540
int(result[cur.first][cur.second]), 0, 0, 0);
541541
}
542542

543-
void TaskJudger::stop() { isJudging = false; }
543+
void TaskJudger::stop() { isJudging = false; }

0 commit comments

Comments
 (0)