Skip to content

Commit

Permalink
Nit
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Jul 14, 2024
1 parent 2095a0f commit 513ea59
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/arkworks/te_sw_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait SWMapping<C: SWCurveConfig> {

fn into_sw(self) -> WeierstrassAffine<C>;

fn to_sw_slice(other: &[Self]) -> Cow<[WeierstrassAffine<C>]>
fn to_sw_slice(slice: &[Self]) -> Cow<[WeierstrassAffine<C>]>
where
Self: Sized;
}
Expand All @@ -69,8 +69,8 @@ impl<C: SWCurveConfig> SWMapping<C> for WeierstrassAffine<C> {
}

#[inline(always)]
fn to_sw_slice(other: &[Self]) -> Cow<[WeierstrassAffine<C>]> {
Cow::Borrowed(other)
fn to_sw_slice(slice: &[Self]) -> Cow<[WeierstrassAffine<C>]> {
Cow::Borrowed(slice)
}
}

Expand All @@ -90,16 +90,16 @@ impl<C: MapConfig> SWMapping<C> for EdwardsAffine<C> {
}

#[inline(always)]
fn to_sw_slice(other: &[Self]) -> Cow<[WeierstrassAffine<C>]> {
fn to_sw_slice(slice: &[Self]) -> Cow<[WeierstrassAffine<C>]> {
let pks;
#[cfg(feature = "parallel")]
{
use rayon::prelude::*;
pks = other.par_iter().map(|p| p.into_sw()).collect();
pks = slice.par_iter().map(|p| p.into_sw()).collect();
}
#[cfg(not(feature = "parallel"))]
{
pks = other.iter().map(|p| p.into_sw()).collect();
pks = slice.iter().map(|p| p.into_sw()).collect();
}
Cow::Owned(pks)
}
Expand Down

0 comments on commit 513ea59

Please sign in to comment.