BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9fa94326
Commit
9fa94326
authored
Mar 29, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Memoize object class titles
For an issue with around 200 notes this cuts down timings by around 150 milliseconds.
parent
8c49eaa9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
abstract_reference_filter.rb
lib/banzai/filter/abstract_reference_filter.rb
+9
-1
No files found.
lib/banzai/filter/abstract_reference_filter.rb
View file @
9fa94326
...
...
@@ -22,6 +22,10 @@ module Banzai
@data_reference
||=
"data-
#{
object_name
.
dasherize
}
"
end
def
self
.
object_class_title
@object_title
||=
object_class
.
name
.
titleize
end
# Public: Find references in text (like `!123` for merge requests)
#
# AnyReferenceFilter.references_in(text) do |match, id, project_ref, matches|
...
...
@@ -53,6 +57,10 @@ module Banzai
self
.
class
.
object_sym
end
def
object_class_title
self
.
class
.
object_class_title
end
def
references_in
(
*
args
,
&
block
)
self
.
class
.
references_in
(
*
args
,
&
block
)
end
...
...
@@ -206,7 +214,7 @@ module Banzai
end
def
object_link_title
(
object
)
"
#{
object_class
.
name
.
titleiz
e
}
:
#{
object
.
title
}
"
"
#{
object_class
_titl
e
}
:
#{
object
.
title
}
"
end
def
object_link_text
(
object
,
matches
)
...
...
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