Commit 4cd99b39 authored by Kerri Miller's avatar Kerri Miller

Extract #uncached_files logic

parent b82131be
......@@ -31,10 +31,6 @@ module Gitlab
# IO generated by N+1's (1 writing for each highlighted line or file).
#
def write_if_empty
diff_files = @diff_collection.diff_files
cached_diff_files = read_cache
uncached_files = diff_files.select { |file| cached_diff_files[file.file_path].nil? }
return if uncached_files.empty?
new_cache_content = {}
......@@ -59,6 +55,13 @@ module Gitlab
private
def uncached_files
diff_files = @diff_collection.diff_files
cached_diff_files = read_cache
diff_files.select { |file| cached_diff_files[file.file_path].nil? }
end
# Given a hash of:
# { "file/to/cache" =>
# [ { line_code: "a5cc2925ca8258af241be7e5b0381edf30266302_19_19",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment