From 31d49d44328cc7e2b660ee2aacc139f5da5cba3b Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 19 Mar 2026 14:32:03 -0700 Subject: [PATCH] clean up perf --- src/commands/perf.zig | 4 ++-- src/tui/perf_tab.zig | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/commands/perf.zig b/src/commands/perf.zig index 620d7df..81db9e2 100644 --- a/src/commands/perf.zig +++ b/src/commands/perf.zig @@ -124,7 +124,7 @@ pub fn printReturnsTable( ); if (price_arr[i] != null) { - try cli.setGainLoss(out, color, if (row.price_positive) @as(f64, 1) else @as(f64, -1)); + try cli.setGainLoss(out, color, if (row.price_positive) 1.0 else -1.0); } else { try cli.setFg(out, color, cli.CLR_MUTED); } @@ -133,7 +133,7 @@ pub fn printReturnsTable( if (has_total) { if (row.total_str) |ts| { - try cli.setGainLoss(out, color, if (row.price_positive) @as(f64, 1) else @as(f64, -1)); + try cli.setGainLoss(out, color, if (row.price_positive) 1.0 else -1.0); try out.print(" {s:>13}", .{ts}); try cli.reset(out, color); } else { diff --git a/src/tui/perf_tab.zig b/src/tui/perf_tab.zig index afb10f3..a8f36af 100644 --- a/src/tui/perf_tab.zig +++ b/src/tui/perf_tab.zig @@ -29,8 +29,6 @@ pub fn buildStyledLines(self: *App, arena: std.mem.Allocator) ![]const StyledLin } try lines.append(arena, .{ .text = "", .style = th.contentStyle() }); - if (self.candles == null and !self.perf_loaded) self.loadPerfData(); - if (self.trailing_price == null) { try lines.append(arena, .{ .text = try std.fmt.allocPrint(arena, " No data. Run: zfin perf {s}", .{self.symbol}), .style = th.mutedStyle() }); return lines.toOwnedSlice(arena);