Skip to content

Commit

Permalink
Merge pull request #172 from SparklesCN/master
Browse files Browse the repository at this point in the history
Fixed bug "[WARN] Failed to get submission beat ratio." on Issues@156
  • Loading branch information
skygragon authored Sep 28, 2019
2 parents 7dd96fc + 4657db6 commit 5a27061
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/commands/submit.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ cmd.handler = function(argv) {

let ratio = 0.0;
for (let score of scores) {
if (parseFloat(score[0]) > myRuntime)
if (parseFloat(score[0]) >= myRuntime)
ratio += parseFloat(score[1]);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/leetcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ plugin.getSubmission = function(submission, cb) {
let re = body.match(/submissionCode:\s('[^']*')/);
if (re) submission.code = eval(re[1]);

re = body.match(/distribution_formatted:\s('[^']+')/);
re = body.match(/runtimeDistributionFormatted:\s('[^']+')/);
if (re) submission.distributionChart = JSON.parse(eval(re[1]));
return cb(null, submission);
});
Expand Down

0 comments on commit 5a27061

Please sign in to comment.