Skip to content

Commit

Permalink
Reuse row while scanning for row patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
gioele committed Aug 13, 2011
1 parent ab7e5dc commit 1c42501
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/rqrcode/qrcode/qr_util.rb
Expand Up @@ -208,15 +208,15 @@ def QRUtil.get_lost_point( qr_code )
end

# level 3
( 0...module_count ).each do |row|
( 0...( module_count - 6 ) ).each do |col|
if modules[row][col] &&
!modules[row][col + 1] &&
modules[row][col + 2] &&
modules[row][col + 3] &&
modules[row][col + 4] &&
!modules[row][col + 5] &&
modules[row][col + 6]
modules.each do |row|
(module_count - 6).times do |col_idx|
if row[col_idx] &&
!row[col_idx + 1] &&
row[col_idx + 2] &&
row[col_idx + 3] &&
row[col_idx + 4] &&
!row[col_idx + 5] &&
row[col_idx + 6]
lost_point += DEMERIT_POINTS_3
end
end
Expand Down

0 comments on commit 1c42501

Please sign in to comment.