Skip to content

Commit a27a41f

Browse files
committed
Merge branch 'perf-2' into perf-3
2 parents 54bdf28 + 19d202a commit a27a41f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

go/olc.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,13 @@ func CheckFull(code string) error {
189189
return nil
190190
}
191191

192+
func upper(b byte) byte {
193+
if 'c' <= b && b <= 'x' {
194+
return b + 'C' - 'c'
195+
}
196+
return b
197+
}
198+
192199
// StripCode strips the padding and separator characters from the code.
193200
//
194201
// The code is truncated to the first 15 digits, as Decode won't use more,
@@ -200,7 +207,7 @@ func StripCode(code string) string {
200207
if r == Separator || r == Padding {
201208
continue
202209
}
203-
result[pos] = byte(r)
210+
result[pos] = upper(byte(r))
204211
pos++
205212
if pos >= maxCodeLen {
206213
break

0 commit comments

Comments
 (0)