Terminal styling and layout widgets for OCaml (tables, trees, panels, colors)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tty: drop dead [mutable frame] field on progress state

Warning 69. [display] wrote the field each call but nothing read it;
the frame index is recomputed from elapsed time inside the same
function each tick. Removing the field and the three write sites.

-4
-4
lib/progress.ml
··· 173 173 type t = { 174 174 cfg : config; 175 175 mutable s : state; 176 - mutable frame : int; 177 176 mutable finished : bool; 178 177 enabled : bool; 179 178 start_time : float; ··· 231 230 if t.enabled && not t.finished then begin 232 231 let elapsed = Unix.gettimeofday () -. t.start_time in 233 232 let frame = int_of_float (elapsed *. 10.) in 234 - t.frame <- frame; 235 233 let lines = render_block ~frame t in 236 234 with_unlimited_margin t.cfg.ppf (fun () -> 237 235 clear_block t.cfg.ppf t.rendered_height; ··· 250 248 { 251 249 cfg; 252 250 s; 253 - frame = 0; 254 251 finished = false; 255 252 enabled; 256 253 start_time; ··· 313 310 314 311 let reset t ~total msg = 315 312 t.s <- state ~total msg; 316 - t.frame <- 0; 317 313 t.finished <- false; 318 314 Queue.clear t.status_buffer; 319 315 display t