long running qrcode fix

zxing 110ef9e8f2733c051dd00e95bddc1bff6ab94ca5
This commit is contained in:
Henry Schimke
2023-01-09 10:39:19 -06:00
parent 5a51bb1274
commit 9efab236e3
3 changed files with 14 additions and 5 deletions

View File

@@ -716,6 +716,15 @@ impl FinderPatternFinder {
return Err(Exceptions::NotFoundException(None));
}
// for (Iterator<FinderPattern> it = possibleCenters.iterator(); it.hasNext();) {
// if (it.next().getCount() < CENTER_QUORUM) {
// it.remove();
// }
// }
self.possibleCenters
.retain(|fp| fp.getCount() >= Self::CENTER_QUORUM);
self.possibleCenters.sort_by(|x, y| {
x.getEstimatedModuleSize()
.partial_cmp(&y.getEstimatedModuleSize())