diff --git a/lib/elixir/lib/map.ex b/lib/elixir/lib/map.ex index 9897d75574..ee56679d64 100644 --- a/lib/elixir/lib/map.ex +++ b/lib/elixir/lib/map.ex @@ -1138,9 +1138,9 @@ defmodule Map do > #### Performance considerations {: .tip} > > If you find yourself doing multiple calls to `Map.filter/2` - > and `Map.reject/2` in a pipeline, it is likely more efficient - > to use `Enum.map/2` and `Enum.filter/2` instead and convert to - > a map at the end using `Map.new/1`. + > and/or `Map.reject/2` in a pipeline, it is likely more efficient + > to use `Enum.filter/2` and `Enum.reject/2` instead and convert to + > a map at the end using `Map.new/1` or `Map.new/2`. ## Examples @@ -1172,6 +1172,13 @@ defmodule Map do See also `filter/2`. + > #### Performance considerations {: .tip} + > + > If you find yourself doing multiple calls to `Map.filter/2` + > and/or `Map.reject/2` in a pipeline, it is likely more efficient + > to use `Enum.filter/2` and `Enum.reject/2` instead and convert to + > a map at the end using `Map.new/1` or `Map.new/2`. + ## Examples iex> Map.reject(%{one: 1, two: 2, three: 3}, fn {_key, val} -> rem(val, 2) == 1 end)