Skip to content

Commit

Permalink
No need to map twice
Browse files Browse the repository at this point in the history
  • Loading branch information
urschrei committed Oct 8, 2023
1 parent 88b1592 commit 015baad
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions rstar-benches/benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,9 @@ fn bulk_load_complex_geom_cached(c: &mut Criterion) {
c.bench_function(
"Bulk load complex geo-types geom with cached envelope",
move |b| {
let polys: Vec<_> =
create_random_polygons(DEFAULT_BENCHMARK_TREE_SIZE, 4096, SEED_1).collect();
let cached: Vec<_> = polys
.into_iter()
.map(|poly| CachedEnvelope::new(poly))
let cached: Vec<_> = create_random_polygons(DEFAULT_BENCHMARK_TREE_SIZE, 4096, SEED_1)
.map(CachedEnvelope::new)
.collect();

b.iter(|| {
RTree::<CachedEnvelope<_>, Params>::bulk_load_with_params(cached.clone());
});
Expand Down

0 comments on commit 015baad

Please sign in to comment.