Skip to content

Commit

Permalink
Return directly instead of setting variable
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
Jacalz committed Oct 30, 2023
1 parent c4f0e60 commit 290db00
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2825,17 +2825,11 @@ func chooseQRCodeVersion(level RecoveryLevel, encoder *dataEncoder, numDataBits

func (v qrCodeVersion) numTerminatorBitsRequired(numDataBits int) int {
numFreeBits := v.numDataBits() - numDataBits

var numTerminatorBits int

switch {
case numFreeBits >= 4:
numTerminatorBits = 4
default:
numTerminatorBits = numFreeBits
if numFreeBits >= 4 {
return 4
}

return numTerminatorBits
return numDataBits
}

// numBlocks returns the number of blocks.
Expand Down

0 comments on commit 290db00

Please sign in to comment.