Skip to content

Commit 9a49d51

Browse files
committed
ProgressBarCache: clear the cache when there is nothing to draw
This was having interesting effects when switching between network files and local files (which leave `demuxer-cache-state` empty). This may end up doing extra work since it doesn't cache the value, but I expect the cache comparison would actually be more expensive than just repeatedly clobbering the value when there's nothing to draw.
1 parent 654aaa3 commit 9a49d51

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ProgressBarCache.moon

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class ProgressBarCache extends BarBase
2727
-- undo BarBase size update
2828
@line[9] = [[]]
2929

30+
clobber: =>
31+
@line[9] = ""
32+
@line[11] = ""
33+
3034
redraw: =>
3135
super!
3236

@@ -93,5 +97,7 @@ class ProgressBarCache extends BarBase
9397

9498
@cacheKey = cacheKey
9599
@needsUpdate = true
100+
else
101+
@clobber!
96102

97103
return @needsUpdate

0 commit comments

Comments
 (0)