"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/golang.org/x/text/transform/transform.go" between
boulder-release-2020-06-23.tar.gz and boulder-release-2020-06-29.tar.gz

About: Boulder is an ACME-based Certificate Authority (CA) used by Let’s Encrypt (written in Go).

transform.go  (boulder-release-2020-06-23):transform.go  (boulder-release-2020-06-29)
skipping to change at line 651 skipping to change at line 651
// Prevent duplicate Transform calls with atEOF being true at the end of // Prevent duplicate Transform calls with atEOF being true at the end of
// the input. Also return if we have an unrecoverable error. // the input. Also return if we have an unrecoverable error.
if (err == nil && pSrc == len(s)) || if (err == nil && pSrc == len(s)) ||
(err != nil && err != ErrShortDst && err != ErrShortSrc) { (err != nil && err != ErrShortDst && err != ErrShortSrc) {
return string(dst[:pDst]), pSrc, err return string(dst[:pDst]), pSrc, err
} }
// Transform the remaining input, growing dst and src buffers as necessar y. // Transform the remaining input, growing dst and src buffers as necessar y.
for { for {
n := copy(src, s[pSrc:]) n := copy(src, s[pSrc:])
nDst, nSrc, err := t.Transform(dst[pDst:], src[:n], pSrc+n == len atEOF := pSrc+n == len(s)
(s)) nDst, nSrc, err := t.Transform(dst[pDst:], src[:n], atEOF)
pDst += nDst pDst += nDst
pSrc += nSrc pSrc += nSrc
// If we got ErrShortDst or ErrShortSrc, do not grow as long as w e can // If we got ErrShortDst or ErrShortSrc, do not grow as long as w e can
// make progress. This may avoid excessive allocations. // make progress. This may avoid excessive allocations.
if err == ErrShortDst { if err == ErrShortDst {
if nDst == 0 { if nDst == 0 {
dst = grow(dst, pDst) dst = grow(dst, pDst)
} }
} else if err == ErrShortSrc { } else if err == ErrShortSrc {
if atEOF {
return string(dst[:pDst]), pSrc, err
}
if nSrc == 0 { if nSrc == 0 {
src = grow(src, 0) src = grow(src, 0)
} }
} else if err != nil || pSrc == len(s) { } else if err != nil || pSrc == len(s) {
return string(dst[:pDst]), pSrc, err return string(dst[:pDst]), pSrc, err
} }
} }
} }
// Bytes returns a new byte slice with the result of converting b[:n] using t, // Bytes returns a new byte slice with the result of converting b[:n] using t,
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)