From b8f27a42a75169c22c3fec5e24555fffcd29c499 Mon Sep 17 00:00:00 2001 From: syeopite Date: Sun, 26 Sep 2021 14:42:00 -0700 Subject: [PATCH] Optimize assigning of on_response_received_endpoints --- src/invidious/comments.cr | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 3370b088..ffdce000 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -72,8 +72,7 @@ def fetch_youtube_comments(id, cursor, format, locale, thin_mode, region, sort_b response = YoutubeAPI.next(continuation: ctoken, client_config: client_config) contents = nil - if response["onResponseReceivedEndpoints"]? - on_response_received_endpoints = response["onResponseReceivedEndpoints"] + if on_response_received_endpoints = response["onResponseReceivedEndpoints"]? header = nil on_response_received_endpoints.as_a.each do |item| if item["reloadContinuationItemsCommand"]?