diff --git a/CHANGELOG.md b/CHANGELOG.md index a56f4f05c..4478277b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ Change log itself follows [Keep a CHANGELOG](http://keepachangelog.com) format. ### Fixed +* `Faker.Util.pick/1` performance regression [[@aptinio][]] + ### Security ## 0.11.1 diff --git a/lib/faker/util.ex b/lib/faker/util.ex index 9edcb42cb..9945083a5 100644 --- a/lib/faker/util.ex +++ b/lib/faker/util.ex @@ -27,9 +27,7 @@ defmodule Faker.Util do end def pick(enum) do - enum - |> Enum.to_list() - |> Enum.at(Faker.random_between(0, Enum.count(enum) - 1)) + Enum.at(enum, Faker.random_between(0, Enum.count(enum) - 1)) end @doc """