Skip to content

Commit

Permalink
refactor: Remove if statements that are always true
Browse files Browse the repository at this point in the history
  • Loading branch information
Apricot-S committed Sep 25, 2024
1 parent 0c3395b commit e543c32
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,16 @@ fn count_zipai_block(
acc.num_mianzi += 1;
acc.num_gulipai += 1;
acc.gulipai.set(i, true);

if zipai_four_tiles[i] {
acc.four_tiles_gulipai.set(i, true);
}
debug_assert!(zipai_four_tiles[i]);
acc.four_tiles_gulipai.set(i, true);
}
3 => {
debug_assert!(!zipai_four_tiles[i]);
acc.num_mianzi += 1;
}
3 => acc.num_mianzi += 1,
2 => {
if Some(i) != jiangpai {
debug_assert!(!zipai_four_tiles[i]);
acc.num_duizi += 1;
}
}
Expand Down Expand Up @@ -417,14 +419,16 @@ fn count_19m_block(
acc.num_mianzi += 1;
acc.num_gulipai += 1;
acc.gulipai.set(i, true);

if wanzi_four_tiles[i] {
acc.four_tiles_gulipai.set(i, true);
}
debug_assert!(wanzi_four_tiles[i]);
acc.four_tiles_gulipai.set(i, true);
}
3 => {
debug_assert!(!wanzi_four_tiles[i]);
acc.num_mianzi += 1;
}
3 => acc.num_mianzi += 1,
2 => {
if Some(i) != jiangpai {
debug_assert!(!wanzi_four_tiles[i]);
acc.num_duizi += 1;
}
}
Expand Down

0 comments on commit e543c32

Please sign in to comment.