Unverified Commit e03e3f73 authored by Jack Koenig's avatar Jack Koenig Committed by GitHub
Browse files

Use Vec.apply instead of new Vec in VecInit.apply (#825)

The Vec constructor invokes the gen argument for each element in the
Vec. Since VecInit invokes cloneSupertype which touches every element of
the input Seq, this was an n^2 operation. Vec.apply accepts its
arguments by value so cloneSupertype is only called once. It then calls
cloneType on that once for each element in the Vec, which is constant
time reducing the overall complexity of VecInit to just n.
parent d64ee7dd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment