From 9233f71549ce397dc82cba90d0379bc461f64e4b Mon Sep 17 00:00:00 2001 From: matthewmcgarvey Date: Mon, 17 Jan 2022 13:03:36 -0600 Subject: [PATCH] Use &.methods where possible instead of curly braces --- src/invidious/comments.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index 5302cc53..dda92440 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -276,7 +276,7 @@ def fetch_reddit_comments(id, sort_by = "confidence") # For videos that have more than one thread, choose the one with the highest score threads = search_results.data.as(RedditListing).children - thread = threads.max_by? { |child| child.data.as(RedditLink).score }.try(&.data.as(RedditLink)) + thread = threads.max_by?(&.data.as(RedditLink).score).try(&.data.as(RedditLink)) result = thread.try do |t| body = client.get("/r/#{t.subreddit}/comments/#{t.id}.json?limit=100&sort=#{sort_by}", headers).body Array(RedditThing).from_json(body)