Skip to content

Commit

Permalink
Fix order of challenge verdict checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Defelo committed Oct 2, 2023
1 parent 4a3d2d3 commit a2dccfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions challenges/src/services/judge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ impl Judge<'_> {
x => x?,
};
if let Some(verdict) = match (time_limit, memory_limit) {
_ if output.run.status != 0 => Some(ChallengesVerdict::RuntimeError),
_ if output.run.stdout.is_empty() => Some(ChallengesVerdict::NoOutput),
(Some(time_limit), _) if output.run.resource_usage.time > time_limit => {
Some(ChallengesVerdict::TimeLimitExceeded)
}
(_, Some(memory_limit)) if output.run.resource_usage.memory / 1024 > memory_limit => {
Some(ChallengesVerdict::MemoryLimitExceeded)
}
_ if output.run.status != 0 => Some(ChallengesVerdict::RuntimeError),
_ if output.run.stdout.is_empty() => Some(ChallengesVerdict::NoOutput),
_ => None,
} {
return Ok(CheckResult {
Expand Down

0 comments on commit a2dccfd

Please sign in to comment.