mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
Use a find instead of an each loop
This commit is contained in:
parent
7b6b914c7b
commit
2d1437f6ff
@ -291,10 +291,9 @@ struct Invidious::User
|
||||
|
||||
def from_newpipe(user : User, body : String) : Bool
|
||||
Compress::Zip::File.open(IO::Memory.new(body), true) do |file|
|
||||
file.entries.each do |entry|
|
||||
entry = file.entries.find { |file_entry| file_entry.filename == "newpipe.db" }
|
||||
return false if entry.nil?
|
||||
entry.open do |file_io|
|
||||
next if entry.filename != "newpipe.db"
|
||||
|
||||
# Ensure max size of 4MB
|
||||
io_sized = IO::Sized.new(file_io, 0x400000)
|
||||
|
||||
@ -327,7 +326,6 @@ struct Invidious::User
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Success!
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user