From a0bca42a7ad98a37f4bdc4d7adc419471163edfb Mon Sep 17 00:00:00 2001 From: Wim Date: Wed, 5 May 2021 22:03:28 +0200 Subject: Update vendor (#1461) * Update vendored libs * Fix slack api changes --- vendor/golang.org/x/text/internal/language/parse.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vendor/golang.org/x/text/internal') diff --git a/vendor/golang.org/x/text/internal/language/parse.go b/vendor/golang.org/x/text/internal/language/parse.go index 2be83e1d..a2fdad89 100644 --- a/vendor/golang.org/x/text/internal/language/parse.go +++ b/vendor/golang.org/x/text/internal/language/parse.go @@ -133,14 +133,15 @@ func (s *scanner) resizeRange(oldStart, oldEnd, newSize int) { s.start = oldStart if end := oldStart + newSize; end != oldEnd { diff := end - oldEnd - if end < cap(s.b) { - b := make([]byte, len(s.b)+diff) + var b []byte + if n := len(s.b) + diff; n > cap(s.b) { + b = make([]byte, n) copy(b, s.b[:oldStart]) - copy(b[end:], s.b[oldEnd:]) - s.b = b } else { - s.b = append(s.b[end:], s.b[oldEnd:]...) + b = s.b[:n:n] } + copy(b[end:], s.b[oldEnd:]) + s.b = b s.next = end + (s.next - s.end) s.end = end } -- cgit v1.2.3