Skip to content

Commit

Permalink
rewrite some getters that were unnecessarily mutating the internal hash
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-makarov committed Jan 30, 2021
1 parent 2eac0be commit b64674c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/cocoapods-core/podfile/target_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def abstract=(abstract)
# @return [String] the inheritance mode for this target definition.
#
def inheritance
get_hash_value('inheritance', 'complete')
get_hash_value('inheritance') || 'complete'
end

# Sets the inheritance mode for this target definition.
Expand Down Expand Up @@ -907,7 +907,7 @@ def get_hash_value(key, base_value = nil)
unless HASH_KEYS.include?(key)
raise StandardError, "Unsupported hash key `#{key}`"
end
internal_hash[key] = base_value if internal_hash[key].nil?
internal_hash[key] ||= base_value unless base_value.nil?
internal_hash[key]
end

Expand Down

0 comments on commit b64674c

Please sign in to comment.