PickValue
will advance a begin iterator on the outpoints
set, which is expensive, because it only has a ++
operator. As it is called in a loop of num_in
(~outpoints.size()
), the runtime is O(outpoints.size() ^ 2)
.
Fix it by making the runtime linear.