mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
Progress: avoid race on global_progress.draw_buffer
This commit is contained in:
parent
9356cb1475
commit
14caccb477
@ -669,14 +669,8 @@ fn appendTreeSymbol(symbol: TreeSymbol, buf: []u8, start_i: usize) usize {
|
||||
fn clearWrittenWithEscapeCodes() anyerror!void {
|
||||
if (!global_progress.need_clear) return;
|
||||
|
||||
var i: usize = 0;
|
||||
const buf = global_progress.draw_buffer;
|
||||
|
||||
buf[i..][0..clear.len].* = clear.*;
|
||||
i += clear.len;
|
||||
|
||||
global_progress.need_clear = false;
|
||||
try write(buf[0..i]);
|
||||
try write(clear);
|
||||
}
|
||||
|
||||
/// U+25BA or ►
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user