refactor: use reverse! and uniq! to modify the array in place
All checks were successful
Invidious CI / build (push) Successful in 5m27s
All checks were successful
Invidious CI / build (push) Successful in 5m27s
This commit is contained in:
parent
a08fafd852
commit
43aa7e7303
2 changed files with 2 additions and 2 deletions
|
@ -482,7 +482,7 @@ module Invidious::Routes::API::V1::Authenticated
|
||||||
env.response.content_type = "text/event-stream"
|
env.response.content_type = "text/event-stream"
|
||||||
|
|
||||||
raw_topics = env.params.body["topics"]? || env.params.query["topics"]?
|
raw_topics = env.params.body["topics"]? || env.params.query["topics"]?
|
||||||
topics = raw_topics.try &.split(",").uniq.first(1000)
|
topics = raw_topics.try &.split(",").uniq!.first(1000)
|
||||||
topics ||= [] of String
|
topics ||= [] of String
|
||||||
|
|
||||||
create_notification_stream(env, topics, CONNECTION_CHANNEL)
|
create_notification_stream(env, topics, CONNECTION_CHANNEL)
|
||||||
|
|
|
@ -724,7 +724,7 @@ module YoutubeAPI
|
||||||
# Multiple encodings can be combined, and are listed in the order
|
# Multiple encodings can be combined, and are listed in the order
|
||||||
# in which they were applied. E.g: "deflate, gzip" means that the
|
# in which they were applied. E.g: "deflate, gzip" means that the
|
||||||
# content must be first "gunzipped", then "defated".
|
# content must be first "gunzipped", then "defated".
|
||||||
encodings.split(',').reverse.each do |enc|
|
encodings.split(',').reverse!.each do |enc|
|
||||||
case enc.strip(' ')
|
case enc.strip(' ')
|
||||||
when "gzip"
|
when "gzip"
|
||||||
body_io = Compress::Gzip::Reader.new(body_io, sync_close: true)
|
body_io = Compress::Gzip::Reader.new(body_io, sync_close: true)
|
||||||
|
|
Loading…
Add table
Reference in a new issue