Skip to content

Commit

Permalink
Early exit if there are no modifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGrimsey committed Jan 18, 2025
1 parent 1399bf3 commit 1f99f2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/feature_placement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,14 @@ fn filter_features_by_blocking_shapes(
noise_cache: &mut NoiseCache,
) {
let _span = info_span!("Filter features by blocking shapes").entered();

let shape_modifiers_in_tile = tile_to_modifier.shape.get(&tile);
let spline_modifiers_in_tile = tile_to_modifier.splines.get(&tile);

if shape_modifiers_in_tile.is_none_or(|entries| entries.is_empty()) && spline_modifiers_in_tile.is_none_or(|entries| entries.is_empty()) {
return;
}

feature_placements.iter_mut().enumerate().for_each(|(feature_group, placements)| {
let feature_group = &terrain_features.feature_groups[feature_group];

Expand Down

0 comments on commit 1f99f2f

Please sign in to comment.