mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-04-27 09:32:16 +02:00
20221228 revert the points length check
This commit is contained in:
parent
42494f95ab
commit
0b77fc6bf3
@ -84,8 +84,8 @@ impl Polygon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn length(&self) -> f64 {
|
pub fn length(&self) -> f64 {
|
||||||
if self.points.len() < 3 {
|
if self.points.is_empty() {
|
||||||
return f64::NAN;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut result = 0.0;
|
let mut result = 0.0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user