From c5d9daa7589a50d2e07d4db963171156ef49c7ed Mon Sep 17 00:00:00 2001 From: Vasil Kolev Date: Thu, 29 Sep 2022 15:21:15 +0300 Subject: [PATCH] parse.php: HOW THE HELL DID THAT WORK EVER --- schedule/parse.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/schedule/parse.php b/schedule/parse.php index 49cf4db..04fd6a4 100644 --- a/schedule/parse.php +++ b/schedule/parse.php @@ -122,8 +122,7 @@ function parseData($config, $data) { $events[$hall_id] = $hall_data; } // Remove halls with no events after filtering - $count = count($events); - for ($i = 0; $i < $count; ++$i) { + foreach ($events as $i => $val) { $hasEvents = false; foreach ($events[$i] as $event_info) { if (!is_null($event_info)) { @@ -141,8 +140,7 @@ function parseData($config, $data) { $events = array_map(null, ...$events); // Filter empty slots - $count = count($events); - for ($i = 0; $i < $count; ++$i) { + foreach($events as $i => $val) { $hall_count = count($events[$i]); $hasEvents = false;