Commit 10bf089f authored by Pedro Pombeiro's avatar Pedro Pombeiro

Apply MR review suggestions

parent c306eda8
...@@ -35,17 +35,9 @@ module Gitlab ...@@ -35,17 +35,9 @@ module Gitlab
# If a circular variable reference is found, the original array is returned # If a circular variable reference is found, the original array is returned
def sort def sort
return @variables if Feature.disabled?(:variable_inside_variable) return @variables if Feature.disabled?(:variable_inside_variable)
return @variables if errors
clear_memoization(:errors) tsort
begin
# Perform a topological sort
variables = tsort
strong_memoize(:errors) { nil }
rescue TSort::Cyclic
variables = @variables
end
variables
end end
private private
......
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