Skip to content

Commit 9233f71

Browse files
Use &.methods where possible instead of curly braces
1 parent b2a738c commit 9233f71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/invidious/comments.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def fetch_reddit_comments(id, sort_by = "confidence")
276276

277277
# For videos that have more than one thread, choose the one with the highest score
278278
threads = search_results.data.as(RedditListing).children
279-
thread = threads.max_by? { |child| child.data.as(RedditLink).score }.try(&.data.as(RedditLink))
279+
thread = threads.max_by?(&.data.as(RedditLink).score).try(&.data.as(RedditLink))
280280
result = thread.try do |t|
281281
body = client.get("/r/#{t.subreddit}/comments/#{t.id}.json?limit=100&sort=#{sort_by}", headers).body
282282
Array(RedditThing).from_json(body)

0 commit comments

Comments
 (0)