Skip to content

Commit

Permalink
get rid off now unnecessary function definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
PragTob committed Mar 27, 2019
1 parent 00395d2 commit f5233ee
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/benchee/formatters/console.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Benchee.Formatters.Console do
flat_map 2.40 K 417.00 μs ±9.40% 411.45 μs 715.21 μs
map.flatten 1.24 K 806.89 μs ±16.62% 768.02 μs 1170.67 μs
Comparison:
Comparison:
flat_map 2.40 K
map.flatten 1.24 K - 1.93x slower
Expand All @@ -26,8 +26,6 @@ defmodule Benchee.Formatters.Console do
alias Benchee.Suite
alias Benchee.Formatters.Console.{Memory, RunTime}

def format(suite), do: format(suite, %{})

@doc """
Formats the benchmark statistics to a report suitable for output on the CLI.
Expand Down Expand Up @@ -80,7 +78,7 @@ defmodule Benchee.Formatters.Console do
"""
@impl true
@spec format(Suite.t(), map) :: [any]
def format(%Suite{scenarios: scenarios, configuration: config}, options) do
def format(%Suite{scenarios: scenarios, configuration: config}, options \\ %{}) do
if Map.has_key?(options, :unit_scaling), do: warn_unit_scaling()

config =
Expand Down Expand Up @@ -109,14 +107,12 @@ defmodule Benchee.Formatters.Console do
end
end

def write(suite), do: write(suite, %{})

@doc """
Takes the output of `format/1` and writes that to the console.
"""
@impl true
@spec write(any, map) :: :ok | {:error, String.t()}
def write(output, _options) do
def write(output, _options \\ %{}) do
IO.write(output)
rescue
_ -> {:error, "Unknown Error"}
Expand Down

0 comments on commit f5233ee

Please sign in to comment.