Skip to content

Commit

Permalink
fix: track change from zxing: zxing/zxing@accc4d5
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Jul 31, 2024
1 parent 3512958 commit 1809161
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/oned/rss/expanded/rss_expanded_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,30 +371,28 @@ impl RSSExpandedReader {
for i in currentRow..self.rows.len() {
// for (int i = currentRow; i < rows.size(); i++) {
let row = self.rows.get(i).ok_or(Exceptions::INDEX_OUT_OF_BOUNDS)?;
self.pairs.clear();
for collectedRow in &collectedRows.clone() {
// for (ExpandedRow collectedRow : collectedRows) {

self.pairs.append(&mut collectedRow.getPairs().to_vec());
}
self.pairs.append(&mut row.getPairs().to_vec());
self.pairs.extend_from_slice(row.getPairs());

let addSize = row.getPairs().len();

if Self::isValidSequence(&self.pairs) {
if self.checkChecksum() {
return Ok(self.pairs.clone());
}

// let rs = collectedRows;
collectedRows.push(row.clone());
// try {

// Recursion: try to add more rows
if let Ok(cr) = self.checkRowsDetails(collectedRows, i + 1) {
return Ok(cr);
} else {
// collectedRows.remove(collectedRows.len() - 1);
collectedRows.truncate(collectedRows.len() - 1);
self.pairs.truncate(addSize);
}
// return checkRows(rs, i + 1);
// } catch (NotFoundException e) {
// We failed, try the next candidate
// }
} else {
self.pairs.truncate(addSize);
}
}

Expand Down

0 comments on commit 1809161

Please sign in to comment.