From 4d456402be1af94779d98e79567778f4db8670a5 Mon Sep 17 00:00:00 2001 From: David Majda Date: Sat, 10 May 2014 16:22:41 +0200 Subject: [PATCH] Small cleanup of benchmark/index.js Update coding style to match the rest of PEG.js. --- benchmark/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/benchmark/index.js b/benchmark/index.js index f13aa41..aded7a9 100644 --- a/benchmark/index.js +++ b/benchmark/index.js @@ -11,8 +11,8 @@ $("#run").click(function() { } function appendResult(klass, title, url, inputSize, parseTime) { - var KB = 1024; - var MS_IN_S = 1000; + var KB = 1024, + MS_IN_S = 1000; resultsTable.append( "" @@ -56,17 +56,17 @@ $("#run").click(function() { * 2. To minimize random errors. */ - var runCount = parseInt($("#run-count").val(), 10); + var runCount = parseInt($("#run-count").val(), 10), + options = { + cache: $("#cache").is(":checked"), + optimize: $("#optimize").val() + }; + if (isNaN(runCount) || runCount <= 0) { alert("Number of runs must be a positive integer."); return; } - var options = { - cache: $("#cache").is(":checked"), - optimize: $("#optimize").val() - }; - Runner.run(benchmarks, runCount, options, { readFile: function(file) { return $.ajax({