Skip to content

Commit a3a0d38

Browse files
committed
pmapsum reduction without assigning to a separate variable
1 parent cea2f2c commit a3a0d38

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ParallelUtilities.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ function pmapsum(f::Function,iterable,args...;kwargs...)
244244
s = fetch(first(futures))
245245
@sync for f in futures[2:end]
246246
@async begin
247-
t_i = fetch(f)
248-
s += t_i
247+
s += fetch(f)
249248
end
250249
end
251250
return s
@@ -264,8 +263,7 @@ function pmapsum_timed(f::Function,iterable,args...;kwargs...)
264263
@timeit timer "fetch" s = fetch(first(futures))
265264
@sync for f in futures[2:end]
266265
@async begin
267-
@timeit timer "fetch" t_i = fetch(f)
268-
s += t_i
266+
@timeit timer "fetch" s += fetch(f)
269267
end
270268
end
271269
return s,timer

0 commit comments

Comments
 (0)