Skip to content

Commit

Permalink
Merge pull request #2181 from ljedrz/fix/2179
Browse files Browse the repository at this point in the history
Don't preallocate in G2Prepared::read_le
  • Loading branch information
howardwu authored Nov 24, 2023
2 parents 657ec6a + cea721e commit 7f69a82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion curves/src/templates/bls12/g2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<P: Bls12Parameters> ToBytes for G2Prepared<P> {
impl<P: Bls12Parameters> FromBytes for G2Prepared<P> {
fn read_le<R: Read>(mut reader: R) -> IoResult<Self> {
let ell_coeffs_len: u32 = FromBytes::read_le(&mut reader)?;
let mut ell_coeffs = Vec::with_capacity(ell_coeffs_len as usize);
let mut ell_coeffs = Vec::new();
for _ in 0..ell_coeffs_len {
let coeff_1: Fp2<P::Fp2Params> = FromBytes::read_le(&mut reader)?;
let coeff_2: Fp2<P::Fp2Params> = FromBytes::read_le(&mut reader)?;
Expand Down

0 comments on commit 7f69a82

Please sign in to comment.