mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
cleanup failures for existing tests
This commit is contained in:
@@ -118,7 +118,7 @@ impl<'a> PatternView<'_> {
|
|||||||
pub fn end(&self) -> Option<PatternType> {
|
pub fn end(&self) -> Option<PatternType> {
|
||||||
if self.start + self.count < self.data.0.len() {
|
if self.start + self.count < self.data.0.len() {
|
||||||
Some(self.data.0[self.start + self.count])
|
Some(self.data.0[self.start + self.count])
|
||||||
}else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ pub fn FindFinderPatterns(image: &BitMatrix, tryHarder: bool) -> FinderPatterns
|
|||||||
while {
|
while {
|
||||||
if let Ok(next) = FindLeftGuard(&next, 0, &PATTERN, 0.5) {
|
if let Ok(next) = FindLeftGuard(&next, 0, &PATTERN, 0.5) {
|
||||||
next.isValid()
|
next.isValid()
|
||||||
}else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
// let Ok(next) = FindLeftGuard(&next, 0, &PATTERN, 0.5) else {
|
// let Ok(next) = FindLeftGuard(&next, 0, &PATTERN, 0.5) else {
|
||||||
@@ -134,6 +134,11 @@ pub fn GenerateFinderPatternSets(patterns: &mut FinderPatterns) -> FinderPattern
|
|||||||
let cosLower: f64 = (135.0_f64 / 180.0 * 3.1415).cos();
|
let cosLower: f64 = (135.0_f64 / 180.0 * 3.1415).cos();
|
||||||
|
|
||||||
let nbPatterns = (patterns).len();
|
let nbPatterns = (patterns).len();
|
||||||
|
|
||||||
|
if nbPatterns < 2 {
|
||||||
|
return FinderPatternSets::default();
|
||||||
|
}
|
||||||
|
|
||||||
for i in 0..(nbPatterns - 2) {
|
for i in 0..(nbPatterns - 2) {
|
||||||
// for (int i = 0; i < nbPatterns - 2; i++) {
|
// for (int i = 0; i < nbPatterns - 2; i++) {
|
||||||
for j in (i + 1)..(nbPatterns - 1) {
|
for j in (i + 1)..(nbPatterns - 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user