Commit cdbe83ac authored by Kerri Miller's avatar Kerri Miller

Memoize feature flag check

parent 8cc25e55
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
module Gitlab module Gitlab
module CodeOwners module CodeOwners
class File class File
include ::Gitlab::Utils::StrongMemoize
SECTION_HEADER_REGEX = /\[(.*?)\]/.freeze SECTION_HEADER_REGEX = /\[(.*?)\]/.freeze
def initialize(blob, project = nil) def initialize(blob, project = nil)
...@@ -155,8 +157,10 @@ module Gitlab ...@@ -155,8 +157,10 @@ module Gitlab
end end
def sectional_codeowners? def sectional_codeowners?
strong_memoize(:sectional_codeowners_check) do
Feature.enabled?(:sectional_codeowners, @project, default_enabled: false) Feature.enabled?(:sectional_codeowners, @project, default_enabled: false)
end end
end end
end end
end
end end
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