Skip to content

Commit 070d372

Browse files
committed
implement countmap ourself
1 parent 07dde6a commit 070d372

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/jet.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,14 @@ expressions for the t′ᵢ that are hopefully easier on the compiler.
239239
end...)
240240
end
241241

242+
function countmap(xs)
243+
counts = Dict{eltype(xs), Int}()
244+
for x in xs
245+
counts[x] = get(counts, x, 0) + 1
246+
end
247+
return counts
248+
end
249+
242250
@generated function (j::Jet{T, N} where T)(x::TaylorBundle{M}) where {N, M}
243251
O = min(M,N)
244252
quote

0 commit comments

Comments
 (0)