Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-02 15:11:04 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-02 15:11:04 +0300
commited509186782d16d2bbcb34ac73303e8cb3a9d5a2 (patch)
tree4ab3bbb33b37e9e4c0f73627617ea6b0c7d0d7f7 /lib/gitlab/utils
parent44837830832a41a6fe6360aca18e50826c723fd1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/utils')
-rw-r--r--lib/gitlab/utils/strong_memoize.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/utils/strong_memoize.rb b/lib/gitlab/utils/strong_memoize.rb
index 50b8428113d..cb3c8f181f9 100644
--- a/lib/gitlab/utils/strong_memoize.rb
+++ b/lib/gitlab/utils/strong_memoize.rb
@@ -88,9 +88,10 @@ module Gitlab
#
# Depending on a type ensure that there's a single memory allocation
def ivar(name)
- if name.is_a?(Symbol)
+ case name
+ when Symbol
name.to_s.prepend("@").to_sym
- elsif name.is_a?(String)
+ when String
:"@#{name}"
else
raise ArgumentError, "Invalid type of '#{name}'"