remove indirection for RxingResultPoint

Previously, the struct was passed around everywhere as a
reference. It only holds two floats, so there's no real
need for indirection. Now it's being passed as a value.
This commit is contained in:
Vukašin Stepanović
2023-02-15 14:42:07 +00:00
parent 145cf704fe
commit 6b7099a03b
12 changed files with 229 additions and 267 deletions

View File

@@ -280,7 +280,7 @@ impl<'a> WhiteRectangleDetector<'_> {
return Err(Exceptions::NotFoundException(None));
}
Ok(self.center_edges(&y.unwrap(), &z.unwrap(), &x.unwrap(), &t.unwrap()))
Ok(self.center_edges(y.unwrap(), z.unwrap(), x.unwrap(), t.unwrap()))
} else {
Err(Exceptions::NotFoundException(None))
}
@@ -322,10 +322,10 @@ impl<'a> WhiteRectangleDetector<'_> {
*/
fn center_edges(
&self,
y: &RXingResultPoint,
z: &RXingResultPoint,
x: &RXingResultPoint,
t: &RXingResultPoint,
y: RXingResultPoint,
z: RXingResultPoint,
x: RXingResultPoint,
t: RXingResultPoint,
) -> [RXingResultPoint; 4] {
//
// t t