Skip to content

Commit

Permalink
Change what was suggested in PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Brunner committed Dec 3, 2019
1 parent 26b9899 commit 8635f1d
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ object Bench {

val (intArgs, args1) = args.span(x => try { x.toInt; true } catch { case _: Throwable => false } )

val warmup = if (intArgs.length > 0) intArgs(0).toInt else 20
val iterations = if (intArgs.length > 1) intArgs(1).toInt else 20
val forks = if (intArgs.length > 2) intArgs(2).toInt else 1
def getIntArg(i: Int, default: Int): Int =
if (intArgs.length > i) intArgs(i).toInt else default

val warmup = getIntArg(0, 20)
val iterations = getIntArg(1, 20)
val forks = getIntArg(2, 1)

if (args1.isEmpty) {
println("Error: no benchmark was specified.")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8635f1d

Please sign in to comment.