Fix Ameba Lint/UselessAssign

This commit is contained in:
syeopite 2025-06-03 16:40:35 -07:00
parent 7226a72824
commit dc198546a0
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
2 changed files with 2 additions and 3 deletions

View File

@ -106,8 +106,7 @@ Spectator.describe StaticAssetsHandler do
file_link = "/#{File.basename(temporary_file.path)}" file_link = "/#{File.basename(temporary_file.path)}"
# Make request # Make request
headers = HTTP::Headers{"Range" => "bytes=0-2"} handle HTTP::Request.new("GET", file_link, HTTP::Headers{"Range" => "bytes=0-2"})
response = handle HTTP::Request.new("GET", file_link, headers)
# Mutate file on disk # Mutate file on disk
temporary_file << "Something else" temporary_file << "Something else"

View File

@ -71,7 +71,7 @@ module Invidious::HttpServer
# Writes file data to the cache # Writes file data to the cache
private def flush_io_to_cache(io, file_path, file_info) private def flush_io_to_cache(io, file_path, file_info)
if @@cached_files.sum(&.[1].size) + (size = file_info.size) < CACHE_LIMIT if @@cached_files.sum(&.[1].size) + file_info.size < CACHE_LIMIT
data_slice = io.to_slice data_slice = io.to_slice
@@cached_files[file_path] = CachedFile.new(data_slice, file_info.size, file_info.modification_time) @@cached_files[file_path] = CachedFile.new(data_slice, file_info.size, file_info.modification_time)
end end