summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/text/internal/language
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-05-05 22:03:28 +0200
committerGitHub <noreply@github.com>2021-05-05 22:03:28 +0200
commita0bca42a7ad98a37f4bdc4d7adc419471163edfb (patch)
tree3e87fdb61128039b016adb4e586636484c63ed52 /vendor/golang.org/x/text/internal/language
parentaf543dcd05cfb5341311e2e214727e26411d2f92 (diff)
downloadmatterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.tar.gz
matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.tar.bz2
matterbridge-msglm-a0bca42a7ad98a37f4bdc4d7adc419471163edfb.zip
Update vendor (#1461)
* Update vendored libs * Fix slack api changes
Diffstat (limited to 'vendor/golang.org/x/text/internal/language')
-rw-r--r--vendor/golang.org/x/text/internal/language/parse.go11
1 files changed, 6 insertions, 5 deletions
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
}