From 505c3aa3bd3faba442ecce6407a9cf1e6b863701 Mon Sep 17 00:00:00 2001 From: Andrew Newdigate Date: Thu, 26 Oct 2017 19:15:07 +0100 Subject: As per Remy's review --- app/controllers/concerns/with_performance_bar.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/controllers/concerns/with_performance_bar.rb b/app/controllers/concerns/with_performance_bar.rb index 6a71d2c5312..84b67be7c6a 100644 --- a/app/controllers/concerns/with_performance_bar.rb +++ b/app/controllers/concerns/with_performance_bar.rb @@ -9,15 +9,7 @@ module WithPerformanceBar return false unless Gitlab::PerformanceBar.enabled?(current_user) cookie = cookies[:perf_bar_enabled] - - unless cookie.present? - if Rails.env.development? - cookies[:perf_bar_enabled] = 'true' - return true - else - return false - end - end + cookie ||= (cookies[:perf_bar_enabled] = 'true') if Rails.env.development? cookie === 'true' end -- cgit v1.2.1