Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4cd99b39
Commit
4cd99b39
authored
Nov 26, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract #uncached_files logic
parent
b82131be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
lib/gitlab/diff/highlight_cache.rb
lib/gitlab/diff/highlight_cache.rb
+7
-4
No files found.
lib/gitlab/diff/highlight_cache.rb
View file @
4cd99b39
...
...
@@ -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",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment