Skip to content

Commit 826fe2d

Browse files
committed
Drop redundant Process.get in Emily.Stream.with_stream/2
Process.put/2 already returns the previous value (or nil), so the preceding Process.get/1 was redundant.
1 parent 9b35d4d commit 826fe2d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

lib/emily/stream.ex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ defmodule Emily.Stream do
8686
"""
8787
@spec with_stream(t(), (-> result)) :: result when result: var
8888
def with_stream(%__MODULE__{worker: w}, fun) when is_function(fun, 0) do
89-
prev = Process.get(:emily_worker)
90-
Process.put(:emily_worker, w)
89+
prev = Process.put(:emily_worker, w)
9190

9291
try do
9392
fun.()

0 commit comments

Comments
 (0)