Use faster, functional code to update video data #12

Merged
gg merged 3 commits from pta/WeatherNews.jl:main into main 2024-05-23 12:00:07 +00:00
Contributor
No description provided.
pta added 3 commits 2024-05-23 05:20:13 +00:00
fb3c3c9199 Replace ugly, inefficient imperative code with functional code
I noticed my algorithm would process the whole array of videos per row
even after finding the target video. To fix it while remaining
imperative, I'd need to break out of a for loop from within a nested if
statement. Maybe it would have worked, but the code would have stayed
ugly and a little hard to reason about.

Using the "filter", "findfirst", and "foreach" higher order functions, I
completely refactored the huge block of nested "for"s and "if"s into a
few functional expressions.

The other notable change is that I'm no longer recording the concurrent
view count on the current live stream, since we're not really interested
in it for our historical analysis purposes, and, being much lower than
the eventual total view count, it would slightly skew calculations
negatively for the current caster.
gg merged commit 735790aa72 into main 2024-05-23 12:00:07 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gg/WeatherNews.jl#12
No description provided.