From f999b7a47ac735d7092aaacfc68e60c7868ff5e3 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 13 Jan 2022 21:48:04 -0500 Subject: [PATCH] use map! --- stdlib/Profile/src/Profile.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/Profile/src/Profile.jl b/stdlib/Profile/src/Profile.jl index 63b70cc9b16c01..1a82e3b2ec85f5 100644 --- a/stdlib/Profile/src/Profile.jl +++ b/stdlib/Profile/src/Profile.jl @@ -351,7 +351,7 @@ end function getdict!(dict::LineInfoDict, data::Vector{UInt}) # we don't want metadata here as we're just looking up ips unique_data_itr = Iterators.unique(has_meta(data) ? strip_meta(data) : data) - foreach(ip -> dict[UInt64(ip)] = StackFrame[], unique_data_itr) + foreach(ip -> dict[UInt64(ip)] = StackFrame[], unique_data_itr) # preallocate @sync for ip in unique_data_itr Threads.@spawn begin st = lookup(convert(Ptr{Cvoid}, ip)) @@ -359,7 +359,7 @@ function getdict!(dict::LineInfoDict, data::Vector{UInt}) # Base.update_stackframes_callback[] stn = map(x->(x, 1), st) try Base.invokelatest(Base.update_stackframes_callback[], stn) catch end - dict[UInt64(ip)] = map(first, stn) + map!(first, dict[UInt64(ip)], stn) end end return dict