bfile icon indicating copy to clipboard operation
bfile copied to clipboard

Why we call `b = b[n:]`, it may have no effect.

Open wathenjiang opened this issue 3 years ago • 2 comments

Please see it in this reference: https://github.com/tidwall/bfile/blob/master/bfile.go#L212

wathenjiang avatar Jan 19 '22 03:01 wathenjiang

The b = b[n:] progresses the b slice forward, which is needed for the loop to terminate at for len(b) > 0 at https://github.com/tidwall/bfile/blob/master/bfile.go#L199

tidwall avatar Jan 28 '22 23:01 tidwall

@tidwall I left out the for loop, thanks you a lot.

wathenjiang avatar Jan 29 '22 02:01 wathenjiang