Skip to content

Commit

Permalink
fix(review): don't use custom capacity
Browse files Browse the repository at this point in the history
Authored-by: RobWalt <[email protected]>
  • Loading branch information
RobWalt committed Jan 23, 2024
1 parent bb2f839 commit d91ae8a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions geo/src/algorithm/stitch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ fn same_line<T: GeoFloat>(l1: &Line<T>, l2: &Line<T>) -> bool {
/// - inner lines: these are all non-boundary lines. They are not unique and have exactly one
/// duplicate on one adjacent polygon in the collection (as long as the input is valid!)
fn find_boundary_lines<T: GeoFloat>(lines: Vec<Line<T>>) -> Vec<Line<T>> {
let init = Vec::with_capacity(lines.len());
lines.into_iter().fold(init, |mut lines, new_line| {
lines.into_iter().fold(Vec::new(), |mut lines, new_line| {
if let Some(idx) = lines.iter().position(|line| same_line(line, &new_line)) {
lines.remove(idx);
} else {
Expand Down

0 comments on commit d91ae8a

Please sign in to comment.