Skip to content

Commit 77365e0

Browse files
committed
rewrite some getters that were unnecessarily mutating the internal hash
1 parent e7cad14 commit 77365e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cocoapods-core/podfile/target_definition.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def abstract=(abstract)
174174
# @return [String] the inheritance mode for this target definition.
175175
#
176176
def inheritance
177-
get_hash_value('inheritance', 'complete')
177+
get_hash_value('inheritance') || 'complete'
178178
end
179179

180180
# Sets the inheritance mode for this target definition.
@@ -907,7 +907,7 @@ def get_hash_value(key, base_value = nil)
907907
unless HASH_KEYS.include?(key)
908908
raise StandardError, "Unsupported hash key `#{key}`"
909909
end
910-
internal_hash[key] = base_value if internal_hash[key].nil?
910+
internal_hash[key] ||= base_value unless base_value.nil?
911911
internal_hash[key]
912912
end
913913

0 commit comments

Comments
 (0)