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.
This commit is contained in:
Jonathan Caicedo 2026-02-26 11:26:39 -05:00
parent a318d919d8
commit 31fb27dffc

View file

@ -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' };