Skip to content

Commit

Permalink
Merge pull request #37 from rust-transit/par_iter
Browse files Browse the repository at this point in the history
start adding par_iter
  • Loading branch information
Tristramg authored Jan 26, 2024
2 parents 47f1551 + 8cf7f91 commit 648195a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osm4routing/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Reader {

fn read_ways(&mut self, file: std::fs::File) {
let mut pbf = osmpbfreader::OsmPbfReader::new(file);
for obj in pbf.iter().flatten() {
for obj in pbf.par_iter().flatten() {
if let osmpbfreader::OsmObj::Way(way) = obj {
let mut properties = EdgeProperties::default();
let mut tags = HashMap::new();
Expand Down Expand Up @@ -157,7 +157,7 @@ impl Reader {
fn read_nodes(&mut self, file: std::fs::File) {
let mut pbf = osmpbfreader::OsmPbfReader::new(file);
self.nodes.reserve(self.nodes_to_keep.len());
for obj in pbf.iter().flatten() {
for obj in pbf.par_iter().flatten() {
if let osmpbfreader::OsmObj::Node(node) = obj {
if self.nodes_to_keep.contains(&node.id) {
self.nodes_to_keep.remove(&node.id);
Expand Down

0 comments on commit 648195a

Please sign in to comment.