summaryrefslogtreecommitdiff
path: root/lib/banzai/filter/snippet_reference_filter.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-03-24 17:00:26 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2016-04-01 11:13:48 +0200
commit84b0ab77667b85a42db8a5a02d9758657af66f16 (patch)
tree5058f048563c8d8e8be4b7e0837d919ff0a878d4 /lib/banzai/filter/snippet_reference_filter.rb
parent82539cff700931532b22b6a8e3d6832137fc5d55 (diff)
downloadgitlab-ce-84b0ab77667b85a42db8a5a02d9758657af66f16.tar.gz
Added & use Gitlab::Routing for URL helpersrouting
Rails' "url_helpers" method creates an anonymous Module (which a bunch of methods) on every call. By caching the output of this method in a dedicated method we can shave off about 10 seconds of loading time for an issue with around 200 comments.
Diffstat (limited to 'lib/banzai/filter/snippet_reference_filter.rb')
-rw-r--r--lib/banzai/filter/snippet_reference_filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/snippet_reference_filter.rb b/lib/banzai/filter/snippet_reference_filter.rb
index c870a42f741..d507eb5ebe1 100644
--- a/lib/banzai/filter/snippet_reference_filter.rb
+++ b/lib/banzai/filter/snippet_reference_filter.rb
@@ -14,7 +14,7 @@ module Banzai
end
def url_for_object(snippet, project)
- h = Gitlab::Application.routes.url_helpers
+ h = Gitlab::Routing.url_helpers
h.namespace_project_snippet_url(project.namespace, project, snippet,
only_path: context[:only_path])
end