Skip to content

Commit

Permalink
correction according Codacy Bot recomendations
Browse files Browse the repository at this point in the history
  • Loading branch information
victron committed Feb 14, 2019
1 parent a561fbf commit fb5ab45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ascii85.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func newAlphaReader(reader io.Reader) *alphaReader {
return &alphaReader{reader: reader}
}

func checkAscii85(r byte) byte {
func checkASCII85(r byte) byte {
if r >= '!' && r <= 'u' { // 33 <= ascii85 <=117
return r
}
Expand All @@ -36,7 +36,7 @@ func (a *alphaReader) Read(p []byte) (int, error) {
buf := make([]byte, n)
tilda := false
for i := 0; i < n; i++ {
char := checkAscii85(p[i])
char := checkASCII85(p[i])
if char == '>' && tilda { // end of data
break
}
Expand Down
11 changes: 6 additions & 5 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -842,14 +842,15 @@ func applyFilter(rd io.Reader, name string, param Value) io.Reader {
return &pngUpReader{r: zr, hist: make([]byte, 1+columns), tmp: make([]byte, 1+columns)}
}
case "ASCII85Decode":
cleanAscii85 := newAlphaReader(rd)
decoder := ascii85.NewDecoder(cleanAscii85)
cleanASCII85 := newAlphaReader(rd)
decoder := ascii85.NewDecoder(cleanASCII85)

if param.Keys() == nil {
return decoder
} else {
switch param.Keys() {
default:
fmt.Println("param=", param)
panic("not expected DecodeParms for ascii85")
case nil:
return decoder
}
}
}
Expand Down

0 comments on commit fb5ab45

Please sign in to comment.