From 8471b621a89e782130b1be3a9f07e7bdd5dcb4a1 Mon Sep 17 00:00:00 2001 From: David Majda Date: Fri, 7 Oct 2016 21:01:41 +0200 Subject: [PATCH] Code style: Fix ESLint "newline-before-return" errors Part of #407. --- benchmark/index.js | 1 + benchmark/run | 3 +++ 2 files changed, 4 insertions(+) diff --git a/benchmark/index.js b/benchmark/index.js index 03ae562..190d95a 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -68,6 +68,7 @@ $("#run").click(() => { if (isNaN(runCount) || runCount <= 0) { alert("Number of runs must be a positive integer."); + return; } diff --git a/benchmark/run b/benchmark/run index 6f60592..bcae9e9 100755 --- a/benchmark/run +++ b/benchmark/run @@ -13,9 +13,11 @@ let fs = require("fs"); function dup(text, count) { let result = ""; + for (let i = 1; i <= count; i++) { result += text; } + return result; } @@ -29,6 +31,7 @@ function padRight(text, length) { function center(text, length) { let padLength = (length - text.length) / 2; + return dup(" ", Math.floor(padLength)) + text + dup(" ", Math.ceil(padLength));