summaryrefslogtreecommitdiff
path: root/vendor/github.com/vbauerster/mpb
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/vbauerster/mpb')
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/bar_filler_bar.go18
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/go.mod2
-rw-r--r--vendor/github.com/vbauerster/mpb/v6/go.sum4
3 files changed, 12 insertions, 12 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v6/bar_filler_bar.go b/vendor/github.com/vbauerster/mpb/v6/bar_filler_bar.go
index 50494485e..1c339e91d 100644
--- a/vendor/github.com/vbauerster/mpb/v6/bar_filler_bar.go
+++ b/vendor/github.com/vbauerster/mpb/v6/bar_filler_bar.go
@@ -94,15 +94,15 @@ func (s *barFiller) parse(style string) {
if !utf8.ValidString(style) {
panic("invalid bar style")
}
- srcFormat := make([][]byte, 0, len(BarDefaultStyle))
- srcRwidth := make([]int, 0, len(BarDefaultStyle))
- gr := uniseg.NewGraphemes(style)
- for gr.Next() {
- srcFormat = append(srcFormat, gr.Bytes())
- srcRwidth = append(srcRwidth, runewidth.StringWidth(gr.Str()))
- }
- copy(s.format, srcFormat)
- copy(s.rwidth, srcRwidth)
+ srcFormat := make([][]byte, len(BarDefaultStyle))
+ srcRwidth := make([]int, len(BarDefaultStyle))
+ i := 0
+ for gr := uniseg.NewGraphemes(style); i < len(BarDefaultStyle) && gr.Next(); i++ {
+ srcFormat[i] = gr.Bytes()
+ srcRwidth[i] = runewidth.StringWidth(gr.Str())
+ }
+ copy(s.format, srcFormat[:i])
+ copy(s.rwidth, srcRwidth[:i])
if s.reverse {
s.tip = s.format[rRevTip]
s.flush = reverseFlush
diff --git a/vendor/github.com/vbauerster/mpb/v6/go.mod b/vendor/github.com/vbauerster/mpb/v6/go.mod
index 3a3d337d2..55d523ed6 100644
--- a/vendor/github.com/vbauerster/mpb/v6/go.mod
+++ b/vendor/github.com/vbauerster/mpb/v6/go.mod
@@ -5,7 +5,7 @@ require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
github.com/mattn/go-runewidth v0.0.10
github.com/rivo/uniseg v0.2.0
- golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78
+ golang.org/x/sys v0.0.0-20210324051608-47abb6519492
)
go 1.14
diff --git a/vendor/github.com/vbauerster/mpb/v6/go.sum b/vendor/github.com/vbauerster/mpb/v6/go.sum
index 1c20f8921..4809b4a19 100644
--- a/vendor/github.com/vbauerster/mpb/v6/go.sum
+++ b/vendor/github.com/vbauerster/mpb/v6/go.sum
@@ -7,5 +7,5 @@ github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY=
-golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210324051608-47abb6519492 h1:Paq34FxTluEPvVyayQqMPgHm+vTOrIifmcYxFBx9TLg=
+golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=