From 31fb27dffc279b2cc34875c16b313b8a4c0424b5 Mon Sep 17 00:00:00 2001 From: Jonathan Caicedo Date: Thu, 26 Feb 2026 11:26:39 -0500 Subject: [PATCH] perf: avoid double-calling row.original.streams - reuse hasStreams This is a micro-optimization, but prevents checking row.original.streams twice and also guards checking for stale streams unless we know we have streams. The performance hit before would have been tiny, but every bit counts. --- frontend/src/components/tables/ChannelsTable.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/tables/ChannelsTable.jsx b/frontend/src/components/tables/ChannelsTable.jsx index 75bf0e33..25bea550 100644 --- a/frontend/src/components/tables/ChannelsTable.jsx +++ b/frontend/src/components/tables/ChannelsTable.jsx @@ -1134,7 +1134,7 @@ const ChannelsTable = ({ onReady }) => { const hasStreams = row.original.streams && row.original.streams.length > 0; const hasStaleStreams = - row.original.streams && row.original.streams.some((s) => s.is_stale); + hasStreams && row.original.streams.some((s) => s.is_stale); if (!hasStreams) { return { className: 'no-streams-row' };