Commit 90a66fa6 authored by Rui Ueyama's avatar Rui Ueyama Committed by Nigel Tao

base32: remove unnecessary "if" condition

This is a patch to apply the same change as CL 76610045.

LGTM=nigeltao
R=nigeltao
CC=golang-codereviews
https://golang.org/cl/77460044
parent 6ea340fd
......@@ -179,13 +179,11 @@ func (e *encoder) Write(p []byte) (n int, err error) {
nn := len(e.out) / 8 * 5
if nn > len(p) {
nn = len(p)
nn -= nn % 5
}
nn -= nn % 5
if nn > 0 {
e.enc.Encode(e.out[0:], p[0:nn])
if _, e.err = e.w.Write(e.out[0 : nn/5*8]); e.err != nil {
return n, e.err
}
e.enc.Encode(e.out[0:], p[0:nn])
if _, e.err = e.w.Write(e.out[0 : nn/5*8]); e.err != nil {
return n, e.err
}
n += nn
p = p[nn:]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment