Skip to content

Commit

Permalink
Revert "WIP"
Browse files Browse the repository at this point in the history
This reverts commit c110126.
  • Loading branch information
helgee committed Jan 26, 2025
1 parent c110126 commit cc74089
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions crates/lox-orbits/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*/

// use rayon::prelude::*;
use rayon::prelude::*;

use glam::DVec3;
use hashbrown::HashMap;
Expand Down Expand Up @@ -804,25 +804,29 @@ pub fn visibility_all(
|mut passes, (gs_name, (gs, mask))| {
passes.insert(
gs_name.clone(),
spacecraft.iter().fold(
HashMap::with_capacity(spacecraft.len()),
|mut passes, (sc_name, sc)| {
passes.insert(
sc_name.clone(),
visibility_dyn(&times, &gs.0, &mask.0, sc, provider)
.into_iter()
.map(PyWindow)
.collect(),
);
passes
},
), // .reduce(
// || HashMap::with_capacity(spacecraft.len()),
// |mut p1, p2| {
// p1.extend(p2.into_iter());
// p1
// },
// ),
spacecraft
.par_iter()
.fold(
|| HashMap::new(),
|mut passes, (sc_name, sc)| {
passes.insert(
sc_name.clone(),
visibility_dyn(&times, &gs.0, &mask.0, sc, provider)
.into_iter()
.map(PyWindow)
.collect(),
);

passes
},
)
.reduce(
|| HashMap::with_capacity(spacecraft.len()),
|mut p1, p2| {
p1.extend(p2.into_iter());
p1
},
),
);
passes
},
Expand Down

0 comments on commit cc74089

Please sign in to comment.