Skip to content

Commit

Permalink
Year 2023, Day 22: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Helbing committed Dec 23, 2023
1 parent f55b1e7 commit 346d23f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions year2023/src/day22.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ type Bricks = Vec<Brick>;

struct BrickWithSupports {
brick: Brick,
supports: HashSet<usize>,
supported_by: HashSet<usize>,
}

Expand Down Expand Up @@ -117,10 +116,9 @@ impl Brick {
fn settle(bricks: Bricks) -> Vec<BrickWithSupports> {
let mut settled_bricks: Vec<BrickWithSupports> = vec![];

for (i, brick) in bricks.iter().enumerate() {
for brick in &bricks {
let mut moved_brick = BrickWithSupports {
brick: brick.clone(),
supports: HashSet::new(),
supported_by: HashSet::new(),
};

Expand All @@ -133,7 +131,6 @@ fn settle(bricks: Bricks) -> Vec<BrickWithSupports> {
if moved_brick.brick.overlap(&settled_brick.brick) {
blocked = true;
moved_brick.supported_by.insert(j);
settled_brick.supports.insert(i);
}
}

Expand Down

0 comments on commit 346d23f

Please sign in to comment.