// snip
// line 380
let h_s = a_s
.into_iter()
.map(|a| {
let h = multiexp(
&worker,
params.get_h(a.len())?, // I found that a.len() is not really used here
FullDensity,
a,
&mut multiexp_kern,
);
Ok(h)
})
.collect::<Result<Vec<_>, SynthesisError>>()?;
This looks correct. Though the code has changed since then, and now we call get_h() only once outside the loop. So it's kind of the optimization you proposed.
git log: 33e5d2ad27c0967fcccea5ffd59ae4970e346518
src/groth16/prover.rs line 380
src/groth16/mapped_params.rs line 59
Does this mean that the logic of get_h can be optimized, without having to create a new builder every time