Inline a lot of functions
This commit is contained in:
@@ -13,16 +13,16 @@ pub struct Game {
|
||||
impl Game {
|
||||
pub fn new(teams: Vec<Vec<Player>>, result: Vec<u16>, p_draw: f64) -> Self {
|
||||
if !result.is_empty() {
|
||||
assert!(
|
||||
debug_assert!(
|
||||
teams.len() == result.len(),
|
||||
"len(result) and (len(teams) != len(result))"
|
||||
);
|
||||
}
|
||||
|
||||
assert!(p_draw >= 0.0 && p_draw < 1.0, "0.0 <= p_draw < 1.0");
|
||||
debug_assert!(p_draw >= 0.0 && p_draw < 1.0, "0.0 <= p_draw < 1.0");
|
||||
|
||||
if p_draw == 0.0 {
|
||||
assert!(
|
||||
debug_assert!(
|
||||
result.iter().collect::<HashSet<_>>().len() == result.len(),
|
||||
"(p_draw == 0.0) and (len(result) > 0) and (len(set(result)) != len(result))"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user