Skip to content

Commit 5dcd39c

Browse files
radarjosevalim
authored andcommitted
Use %{} instead of Map.new in genserver docs (elixir-lang#745)
I am not sure why we're using `Map.new` here instead of `%{}`. On the previous page we're using `%{}`, but here we're using `Map.new` for apparently no reason at all.
1 parent c31d12a commit 5dcd39c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

getting-started/mix-otp/genserver.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ OK
2424
Since agents are processes, each bucket has a process identifier (pid) but it doesn't have a name. We have learned about the name registry [in the Process chapter](/getting-started/processes.html) and you could be inclined to solve this problem by using such registry. For example, we could create a bucket as:
2525

2626
```iex
27-
iex> Agent.start_link(fn -> Map.new end, name: :shopping)
27+
iex> Agent.start_link(fn -> %{} end, name: :shopping)
2828
{:ok, #PID<0.43.0>}
2929
iex> KV.Bucket.put(:shopping, "milk", 1)
3030
:ok

0 commit comments

Comments
 (0)